* [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS
@ 2012-04-26 13:57 Dirk Eibach
2012-04-26 13:57 ` [U-Boot] [PATCH v2] Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set Dirk Eibach
2012-04-27 16:11 ` [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS Tabi Timur-B04825
0 siblings, 2 replies; 4+ messages in thread
From: Dirk Eibach @ 2012-04-26 13:57 UTC (permalink / raw)
To: u-boot
Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Cc: Timur Tabi <timur@freescale.com>
---
Changes in v2:
- add Cc
- split up original patch series
board/freescale/p1022ds/p1022ds.c | 4 ++
board/freescale/p1022ds/tlb.c | 10 ++++++
boards.cfg | 4 ++
include/configs/P1022DS.h | 63 ++++++++++++++++++++++++++++++++++---
4 files changed, 76 insertions(+), 5 deletions(-)
diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c
index 456d9b0..c4bdbad 100644
--- a/board/freescale/p1022ds/p1022ds.c
+++ b/board/freescale/p1022ds/p1022ds.c
@@ -37,6 +37,10 @@ int board_early_init_f(void)
{
ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+ /* Reset eLBC_DIU and SPI_eLBC in case we are booting from SD */
+ clrbits_be32(&gur->pmuxcr, 0x00600000);
+ setbits_be32(&gur->pmuxcr, 0x80000000);
+
/* Set pmuxcr to allow both i2c1 and i2c2 */
setbits_be32(&gur->pmuxcr, 0x1000);
diff --git a/board/freescale/p1022ds/tlb.c b/board/freescale/p1022ds/tlb.c
index e620112..1e9969f 100644
--- a/board/freescale/p1022ds/tlb.c
+++ b/board/freescale/p1022ds/tlb.c
@@ -71,6 +71,16 @@ struct fsl_e_tlb_entry tlb_table[] = {
SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
0, 7, BOOKE_PAGESZ_4K, 1),
+
+#if defined(CONFIG_SYS_RAMBOOT)
+ SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 8, BOOKE_PAGESZ_1G, 1),
+ SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE + 0x40000000,
+ CONFIG_SYS_DDR_SDRAM_BASE + 0x40000000,
+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 9, BOOKE_PAGESZ_1G, 1)
+#endif
};
int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/boards.cfg b/boards.cfg
index 24c5879..8de4235 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -700,6 +700,10 @@ P1021RDB-PC_SDCARD powerpc mpc85xx p1_p2_rdb_pc freesca
P1021RDB-PC_SPIFLASH powerpc mpc85xx p1_p2_rdb_pc freescale - p1_p2_rdb_pc:P1021RDB,SPIFLASH
P1022DS powerpc mpc85xx p1022ds freescale
P1022DS_36BIT powerpc mpc85xx p1022ds freescale - P1022DS:36BIT
+P1022DS_36BIT_SDCARD powerpc mpc85xx p1022ds freescale - P1022DS:36BIT,SDCARD
+P1022DS_36BIT_SPIFLASH powerpc mpc85xx p1022ds freescale - P1022DS:36BIT,SPIFLASH
+P1022DS_SDCARD powerpc mpc85xx p1022ds freescale - P1022DS:SDCARD
+P1022DS_SPIFLASH powerpc mpc85xx p1022ds freescale - P1022DS:SPIFLASH
P1023RDS powerpc mpc85xx p1023rds freescale - P1023RDS
P1023RDS_NAND powerpc mpc85xx p1023rds freescale - P1023RDS:NAND
P1024RDB powerpc mpc85xx p1_p2_rdb_pc freescale - p1_p2_rdb_pc:P1024RDB
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 70d751d..73a56a6 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -26,6 +26,18 @@
#define CONFIG_P1022DS
#define CONFIG_MP /* support multiple processors */
+#ifdef CONFIG_SDCARD
+#define CONFIG_RAMBOOT_SDCARD 1
+#define CONFIG_SYS_TEXT_BASE 0x11000000
+#define CONFIG_RESET_VECTOR_ADDRESS 0x1107fffc
+#endif
+
+#ifdef CONFIG_SPIFLASH
+#define CONFIG_RAMBOOT_SPIFLASH 1
+#define CONFIG_SYS_TEXT_BASE 0x11000000
+#define CONFIG_RESET_VECTOR_ADDRESS 0x1107fffc
+#endif
+
#ifndef CONFIG_SYS_TEXT_BASE
#define CONFIG_SYS_TEXT_BASE 0xeff80000
#endif
@@ -52,8 +64,14 @@
#define CONFIG_FSL_LAW /* Use common FSL init code */
+#if 0
+#define CONFIG_SYS_CLK_FREQ 99999000 /* get_board_sys_clk() */
+#define CONFIG_DDR_CLK_FREQ 99999000 /* get_board_ddr_clk() */
+#else
#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk()
+#endif
+
#define CONFIG_ICS307_REFCLK_HZ 33333000 /* ICS307 clock chip ref freq */
/*
@@ -138,6 +156,14 @@
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#if defined(CONFIG_RAMBOOT_NAND) || defined(CONFIG_RAMBOOT_SDCARD) || \
+ defined(CONFIG_RAMBOOT_SPIFLASH)
+#define CONFIG_SYS_RAMBOOT
+#define CONFIG_SYS_EXTRA_ENV_RELOC
+#else
+#undef CONFIG_SYS_RAMBOOT
+#endif
+
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_SYS_FLASH_EMPTY_INFO
@@ -403,11 +429,38 @@
/*
* Environment
*/
-#define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_OVERWRITE
-#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE 0x2000
-#define CONFIG_ENV_SECT_SIZE 0x20000
+#if defined(CONFIG_SYS_RAMBOOT)
+#if defined(CONFIG_RAMBOOT_NAND)
+#define CONFIG_ENV_IS_IN_NAND 1
+#define CONFIG_ENV_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
+#define CONFIG_ENV_OFFSET ((512 * 1024) + CONFIG_SYS_NAND_BLOCK_SIZE)
+#define CONFIG_ENV_RANGE (3 * CONFIG_ENV_SIZE)
+#elif defined(CONFIG_RAMBOOT_SPIFLASH)
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_BUS 0
+#define CONFIG_ENV_SPI_CS 0
+#define CONFIG_ENV_SPI_MAX_HZ 10000000
+#define CONFIG_ENV_SPI_MODE 0
+#define CONFIG_ENV_SIZE 0x2000 /* 8KB */
+#define CONFIG_ENV_OFFSET 0x100000
+#define CONFIG_ENV_SECT_SIZE 0x10000
+#elif defined(CONFIG_RAMBOOT_SDCARD)
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_FSL_FIXED_MMC_LOCATION
+#define CONFIG_ENV_SIZE 0x2000
+#define CONFIG_SYS_MMC_ENV_DEV 0
+#else
+ #define CONFIG_ENV_IS_NOWHERE 1 /* Store ENV in memory only */
+ #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+ #define CONFIG_ENV_SIZE 0x2000
+#endif
+#else
+ #define CONFIG_ENV_IS_IN_FLASH
+ #define CONFIG_ENV_OVERWRITE
+ #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
+ #define CONFIG_ENV_SIZE 0x2000
+ #define CONFIG_ENV_SECT_SIZE 0x20000
+#endif
#define CONFIG_LOADS_ECHO
#define CONFIG_SYS_LOADS_BAUD_CHANGE
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set
2012-04-26 13:57 [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS Dirk Eibach
@ 2012-04-26 13:57 ` Dirk Eibach
2012-08-09 20:41 ` Wolfgang Denk
2012-04-27 16:11 ` [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS Tabi Timur-B04825
1 sibling, 1 reply; 4+ messages in thread
From: Dirk Eibach @ 2012-04-26 13:57 UTC (permalink / raw)
To: u-boot
When CONFIG_ZERO_BOOTDELAY_CHECK is not defined, bootdelay==0 prevents the check for console input (as stated in README.autoboot).
This must also work in CONFIG_AUTOBOOT_KEYED mode.
Signed-off-by: Dirk Eibach <eibach@gdsys.de>
---
Changes in v2:
- split up original patch series
common/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/common/main.c b/common/main.c
index 3b9e39a..b40f96e 100644
--- a/common/main.c
+++ b/common/main.c
@@ -113,6 +113,11 @@ int abortboot(int bootdelay)
u_int presskey_max = 0;
u_int i;
+#ifndef CONFIG_ZERO_BOOTDELAY_CHECK
+ if (bootdelay == 0)
+ return 0;
+#endif
+
# ifdef CONFIG_AUTOBOOT_PROMPT
printf(CONFIG_AUTOBOOT_PROMPT);
# endif
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS
2012-04-26 13:57 [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS Dirk Eibach
2012-04-26 13:57 ` [U-Boot] [PATCH v2] Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set Dirk Eibach
@ 2012-04-27 16:11 ` Tabi Timur-B04825
1 sibling, 0 replies; 4+ messages in thread
From: Tabi Timur-B04825 @ 2012-04-27 16:11 UTC (permalink / raw)
To: u-boot
On Thu, Apr 26, 2012 at 8:57 AM, Dirk Eibach <eibach@gdsys.de> wrote:
> Signed-off-by: Dirk Eibach <eibach@gdsys.de>
> Cc: Timur Tabi <timur@freescale.com>
> ---
> Changes in v2:
> - add Cc
> - split up original patch series
>
> ?board/freescale/p1022ds/p1022ds.c | ? ?4 ++
> ?board/freescale/p1022ds/tlb.c ? ? | ? 10 ++++++
> ?boards.cfg ? ? ? ? ? ? ? ? ? ? ? ?| ? ?4 ++
> ?include/configs/P1022DS.h ? ? ? ? | ? 63 ++++++++++++++++++++++++++++++++++---
> ?4 files changed, 76 insertions(+), 5 deletions(-)
>
> diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c
> index 456d9b0..c4bdbad 100644
> --- a/board/freescale/p1022ds/p1022ds.c
> +++ b/board/freescale/p1022ds/p1022ds.c
> @@ -37,6 +37,10 @@ int board_early_init_f(void)
> ?{
> ? ? ? ?ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
>
> + ? ? ? /* Reset eLBC_DIU and SPI_eLBC in case we are booting from SD */
> + ? ? ? clrbits_be32(&gur->pmuxcr, 0x00600000);
> + ? ? ? setbits_be32(&gur->pmuxcr, 0x80000000);
Please use clrsetbits_be32().
> +
> ? ? ? ?/* Set pmuxcr to allow both i2c1 and i2c2 */
> ? ? ? ?setbits_be32(&gur->pmuxcr, 0x1000);
>
> diff --git a/board/freescale/p1022ds/tlb.c b/board/freescale/p1022ds/tlb.c
> index e620112..1e9969f 100644
> --- a/board/freescale/p1022ds/tlb.c
> +++ b/board/freescale/p1022ds/tlb.c
> @@ -71,6 +71,16 @@ struct fsl_e_tlb_entry tlb_table[] = {
> ? ? ? ?SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
> ? ? ? ? ? ? ? ? ? ? ?MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
> ? ? ? ? ? ? ? ? ? ? ?0, 7, BOOKE_PAGESZ_4K, 1),
> +
> +#if defined(CONFIG_SYS_RAMBOOT)
> + ? ? ? SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
> + ? ? ? ? ? ? ? ? ? ? ? MAS3_SX|MAS3_SW|MAS3_SR, 0,
> + ? ? ? ? ? ? ? ? ? ? ? 0, 8, BOOKE_PAGESZ_1G, 1),
> + ? ? ? SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE + 0x40000000,
> + ? ? ? ? ? ? ? ? ? ? ? CONFIG_SYS_DDR_SDRAM_BASE + 0x40000000,
> + ? ? ? ? ? ? ? ? ? ? ? MAS3_SX|MAS3_SW|MAS3_SR, 0,
> + ? ? ? ? ? ? ? ? ? ? ? 0, 9, BOOKE_PAGESZ_1G, 1)
> +#endif
> ?};
>
> ?int num_tlb_entries = ARRAY_SIZE(tlb_table);
> diff --git a/boards.cfg b/boards.cfg
> index 24c5879..8de4235 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -700,6 +700,10 @@ P1021RDB-PC_SDCARD ? ? ? ? ? powerpc ? ? mpc85xx ? ? p1_p2_rdb_pc ? ? ? ?freesca
> ?P1021RDB-PC_SPIFLASH ? ? ? ? powerpc ? ? mpc85xx ? ? p1_p2_rdb_pc ? ? ? ?freescale ? ? ?- ? ? ? ? ? p1_p2_rdb_pc:P1021RDB,SPIFLASH
> ?P1022DS ? ? ? ? ? ? ? ? ? ? ?powerpc ? ? mpc85xx ? ? p1022ds ? ? ? ? ? ? freescale
> ?P1022DS_36BIT ? ? ? ? ? ? ? ?powerpc ? ? mpc85xx ? ? p1022ds ? ? ? ? ? ? freescale ? ? ?- ? ? ? ? ? P1022DS:36BIT
> +P1022DS_36BIT_SDCARD ? ? ? ? powerpc ? ? mpc85xx ? ? p1022ds ? ? ? ? ? ? freescale ? ? ?- ? ? ? ? ? P1022DS:36BIT,SDCARD
> +P1022DS_36BIT_SPIFLASH ? ? ? powerpc ? ? mpc85xx ? ? p1022ds ? ? ? ? ? ? freescale ? ? ?- ? ? ? ? ? P1022DS:36BIT,SPIFLASH
> +P1022DS_SDCARD ? ? ? ? ? ? ? powerpc ? ? mpc85xx ? ? p1022ds ? ? ? ? ? ? freescale ? ? ?- ? ? ? ? ? P1022DS:SDCARD
> +P1022DS_SPIFLASH ? ? ? ? ? ? powerpc ? ? mpc85xx ? ? p1022ds ? ? ? ? ? ? freescale ? ? ?- ? ? ? ? ? P1022DS:SPIFLASH
> ?P1023RDS ? ? ? ? ? ? ? ? ? ? powerpc ? ? mpc85xx ? ? p1023rds ? ? ? ? ? ?freescale ? ? ?- ? ? ? ? ? P1023RDS
> ?P1023RDS_NAND ? ? ? ? ? ? ? ?powerpc ? ? mpc85xx ? ? p1023rds ? ? ? ? ? ?freescale ? ? ?- ? ? ? ? ? P1023RDS:NAND
> ?P1024RDB ? ? ? ? ? ? ? ? ? ? powerpc ? ? mpc85xx ? ? p1_p2_rdb_pc ? ? ? ?freescale ? ? ?- ? ? ? ? ? p1_p2_rdb_pc:P1024RDB
> diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
> index 70d751d..73a56a6 100644
> --- a/include/configs/P1022DS.h
> +++ b/include/configs/P1022DS.h
> @@ -26,6 +26,18 @@
> ?#define CONFIG_P1022DS
> ?#define CONFIG_MP ? ? ? ? ? ? ? ? ? ? ?/* support multiple processors */
>
> +#ifdef CONFIG_SDCARD
> +#define CONFIG_RAMBOOT_SDCARD ? ? ? ? ?1
> +#define CONFIG_SYS_TEXT_BASE ? ? ? ? ? 0x11000000
> +#define CONFIG_RESET_VECTOR_ADDRESS ? ?0x1107fffc
> +#endif
> +
> +#ifdef CONFIG_SPIFLASH
> +#define CONFIG_RAMBOOT_SPIFLASH ? ? ? ? ? ? ? ?1
> +#define CONFIG_SYS_TEXT_BASE ? ? ? ? ? 0x11000000
> +#define CONFIG_RESET_VECTOR_ADDRESS ? ?0x1107fffc
> +#endif
> +
> ?#ifndef CONFIG_SYS_TEXT_BASE
> ?#define CONFIG_SYS_TEXT_BASE ? 0xeff80000
> ?#endif
> @@ -52,8 +64,14 @@
>
> ?#define CONFIG_FSL_LAW ? ? ? ? ? ? ? ? /* Use common FSL init code */
>
> +#if 0
> +#define CONFIG_SYS_CLK_FREQ ? ?99999000 ?/* get_board_sys_clk() */
> +#define CONFIG_DDR_CLK_FREQ ? ?99999000 /* get_board_ddr_clk() */
> +#else
Why add these lines?
> ?#define CONFIG_SYS_CLK_FREQ ? ?get_board_sys_clk()
> ?#define CONFIG_DDR_CLK_FREQ ? ?get_board_ddr_clk()
> +#endif
> +
> ?#define CONFIG_ICS307_REFCLK_HZ ? ? ? ?33333000 ?/* ICS307 clock chip ref freq */
>
> ?/*
> @@ -138,6 +156,14 @@
>
> ?#define CONFIG_SYS_MONITOR_BASE ? ? ? ? ? ? ? ?CONFIG_SYS_TEXT_BASE ? ?/* start of monitor */
>
> +#if defined(CONFIG_RAMBOOT_NAND) || defined(CONFIG_RAMBOOT_SDCARD) || \
> + ? ? ? defined(CONFIG_RAMBOOT_SPIFLASH)
> +#define CONFIG_SYS_RAMBOOT
> +#define CONFIG_SYS_EXTRA_ENV_RELOC
> +#else
> +#undef CONFIG_SYS_RAMBOOT
> +#endif
Is the #undef really necessary?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set
2012-04-26 13:57 ` [U-Boot] [PATCH v2] Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set Dirk Eibach
@ 2012-08-09 20:41 ` Wolfgang Denk
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2012-08-09 20:41 UTC (permalink / raw)
To: u-boot
Dear Dirk Eibach,
In message <1335448625-21180-2-git-send-email-eibach@gdsys.de> you wrote:
> When CONFIG_ZERO_BOOTDELAY_CHECK is not defined, bootdelay==0 prevents the check for console input (as stated in README.autoboot).
> This must also work in CONFIG_AUTOBOOT_KEYED mode.
>
> Signed-off-by: Dirk Eibach <eibach@gdsys.de>
> ---
> Changes in v2:
> - split up original patch series
>
>
> common/main.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
Applied, thanks.
But _please_ use a line length of <70 characters in the subject and
the commit message. Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
A door is what a dog is perpetually on the wrong side of.
- Ogden Nash
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-09 20:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 13:57 [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS Dirk Eibach
2012-04-26 13:57 ` [U-Boot] [PATCH v2] Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set Dirk Eibach
2012-08-09 20:41 ` Wolfgang Denk
2012-04-27 16:11 ` [U-Boot] [PATCH v2] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS Tabi Timur-B04825
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.