From d9ac3d5a17ecef0beb70073018925e011b11684e Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Mon, 15 Jun 2009 11:51:47 -0500 Subject: [PATCH 1/4] mpc83xx: set 64BIT_VSPRINTF for boards using nand_util When enabling NAND support for a board, one must also define CONFIG_SYS_64BIT_VSPRINTF because this is needed in nand_util.c for correct output. Signed-off-by: Kim Phillips Cc: Dave Liu Cc: Ron Madrid Cc: Anton Vorontsov --- include/configs/MPC8313ERDB.h | 1 + include/configs/MPC8315ERDB.h | 1 + include/configs/MPC8360ERDK.h | 1 + include/configs/SIMPC8313.h | 1 + 4 files changed, 4 insertions(+) diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h index 2308568695..5149ce792b 100644 --- a/include/configs/MPC8313ERDB.h +++ b/include/configs/MPC8313ERDB.h @@ -236,6 +236,7 @@ #define CONFIG_CMD_NAND 1 #define CONFIG_NAND_FSL_ELBC 1 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384 +#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */ #define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10) #define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000 diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h index e03a1077ff..4cf48f7bc0 100644 --- a/include/configs/MPC8315ERDB.h +++ b/include/configs/MPC8315ERDB.h @@ -226,6 +226,7 @@ #define CONFIG_MTD_NAND_VERIFY_WRITE 1 #define CONFIG_CMD_NAND 1 #define CONFIG_NAND_FSL_ELBC 1 +#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */ #define CONFIG_SYS_BR1_PRELIM ( CONFIG_SYS_NAND_BASE \ | (2< Date: Tue, 30 Jun 2009 15:48:40 +0300 Subject: [PATCH 2/4] usb: mpc834x: added support of the MPH USB controller in addition to the DR one Signed-off-by: Valeriy Glushkov Signed-off-by: Kim Phillips --- cpu/mpc83xx/cpu_init.c | 2 ++ include/asm-ppc/immap_83xx.h | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c index 03b6c86349..5c930d3888 100644 --- a/cpu/mpc83xx/cpu_init.c +++ b/cpu/mpc83xx/cpu_init.c @@ -299,6 +299,7 @@ void cpu_init_f (volatile immap_t * im) im->gpio[1].dir = CONFIG_SYS_GPIO2_DIR; #endif #ifdef CONFIG_USB_EHCI_FSL +#ifndef CONFIG_MPC834x uint32_t temp; struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_MPC8xxx_USB_ADDR; @@ -311,6 +312,7 @@ void cpu_init_f (volatile immap_t * im) udelay(1000); } while (!(temp & PHY_CLK_VALID)); #endif +#endif } int cpu_init_r (void) diff --git a/include/asm-ppc/immap_83xx.h b/include/asm-ppc/immap_83xx.h index 7c6a15185e..c60a7d21c3 100644 --- a/include/asm-ppc/immap_83xx.h +++ b/include/asm-ppc/immap_83xx.h @@ -650,6 +650,12 @@ typedef struct immap { u8 res7[0xC0000]; } immap_t; +#ifdef CONFIG_HAS_FSL_MPH_USB +#define CONFIG_SYS_MPC83xx_USB_OFFSET 0x22000 /* use the MPH controller */ +#else +#define CONFIG_SYS_MPC83xx_USB_OFFSET 0x23000 /* use the DR controller */ +#endif + #elif defined(CONFIG_MPC8313) typedef struct immap { sysconf83xx_t sysconf; /* System configuration */ @@ -856,7 +862,10 @@ typedef struct immap { #define CONFIG_SYS_MPC83xx_DMA_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_DMA_OFFSET) #define CONFIG_SYS_MPC83xx_ESDHC_OFFSET (0x2e000) #define CONFIG_SYS_MPC83xx_ESDHC_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_ESDHC_OFFSET) -#define CONFIG_SYS_MPC83xx_USB_OFFSET 0x23000 + +#ifndef CONFIG_SYS_MPC83xx_USB_OFFSET +#define CONFIG_SYS_MPC83xx_USB_OFFSET 0x23000 +#endif #define CONFIG_SYS_MPC83xx_USB_ADDR \ (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_USB_OFFSET) #endif /* __IMMAP_83xx__ */ From c31e13260bcd048a94412a47b004386ea6112acf Mon Sep 17 00:00:00 2001 From: Valeriy Glushkov Date: Tue, 30 Jun 2009 15:48:41 +0300 Subject: [PATCH 3/4] usb: mpx8349itx: added support of loading images from USB storage (MPH/DR) Signed-off-by: Valeriy Glushkov Signed-off-by: Kim Phillips --- include/configs/MPC8349ITX.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h index d4d3256f75..9183d77948 100644 --- a/include/configs/MPC8349ITX.h +++ b/include/configs/MPC8349ITX.h @@ -79,6 +79,7 @@ #define CONFIG_COMPACT_FLASH /* The CF card interface on the back of the board */ #define CONFIG_VSC7385_ENET /* VSC7385 ethernet support */ #define CONFIG_SATA_SIL3114 /* SIL3114 SATA controller */ +#define CONFIG_SYS_USB_HOST /* use the EHCI USB controller */ #endif #define CONFIG_PCI @@ -155,6 +156,25 @@ #endif +#ifdef CONFIG_SYS_USB_HOST +/* + * Support USB + */ +#define CONFIG_CMD_USB +#define CONFIG_USB_STORAGE +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_FSL + +/* Current USB implementation supports the only USB controller, + * so we have to choose between the MPH or the DR ones */ +#if 1 +#define CONFIG_HAS_FSL_MPH_USB +#else +#define CONFIG_HAS_FSL_DR_USB +#endif + +#endif + /* * DDR Setup */ @@ -456,9 +476,11 @@ boards, we say we have two, but don't display a message if we find only one. */ #define CONFIG_CMD_DHCP #define CONFIG_CMD_SDRAM -#if defined(CONFIG_COMPACT_FLASH) || defined(CONFIG_SATA_SIL3114) +#if defined(CONFIG_COMPACT_FLASH) || defined(CONFIG_SATA_SIL3114) \ + || defined(CONFIG_USB_STORAGE) #define CONFIG_DOS_PARTITION #define CONFIG_CMD_FAT + #define CONFIG_SUPPORT_VFAT #endif #ifdef CONFIG_COMPACT_FLASH @@ -467,6 +489,9 @@ boards, we say we have two, but don't display a message if we find only one. */ #ifdef CONFIG_SATA_SIL3114 #define CONFIG_CMD_SATA +#endif + +#if defined(CONFIG_SATA_SIL3114) || defined(CONFIG_USB_STORAGE) #define CONFIG_CMD_EXT2 #endif @@ -560,12 +585,14 @@ boards, we say we have two, but don't display a message if we find only one. */ #define CONFIG_SYS_SPCR_TSEC2EP 3 /* TSEC2 emergency priority (0-3) */ #define CONFIG_SYS_SCCR_TSEC1CM 1 /* TSEC1 clock mode (0-3) */ #define CONFIG_SYS_SCCR_TSEC2CM 1 /* TSEC2 & I2C0 clock mode (0-3) */ +#define CONFIG_SYS_SCCR_USBMPHCM 3 /* USB MPH controller's clock */ +#define CONFIG_SYS_SCCR_USBDRCM 0 /* USB DR controller's clock */ /* * System IO Config */ #define CONFIG_SYS_SICRH SICRH_TSOBI1 /* Needed for gigabit to work on TSEC 1 */ -#define CONFIG_SYS_SICRL (SICRL_LDP_A | SICRL_USB1) +#define CONFIG_SYS_SICRL (SICRL_LDP_A | SICRL_USB1) /* USB DR as device + USB MPH as host */ #define CONFIG_SYS_HID0_INIT 0x000000000 #define CONFIG_SYS_HID0_FINAL CONFIG_SYS_HID0_INIT From 4a9932a4364b548773bc131bf85e24a2ec15f2b0 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Tue, 7 Jul 2009 18:04:21 -0500 Subject: [PATCH 4/4] mpc83xx: increase MONITOR_LEN to offset growing pains Saving the environment leads to overwriting u-boot itself, bricking boards. Increase u-boot's image size so the environment base address doesn't end up overlapping u-boot text. Signed-off-by: Kim Phillips --- include/configs/MPC8313ERDB.h | 2 +- include/configs/MPC8323ERDB.h | 2 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/MPC8349EMDS.h | 2 +- include/configs/MPC8349ITX.h | 2 +- include/configs/MPC8360EMDS.h | 2 +- include/configs/MPC837XERDB.h | 2 +- include/configs/kmeter1.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h index 5149ce792b..049c80d6ab 100644 --- a/include/configs/MPC8313ERDB.h +++ b/include/configs/MPC8313ERDB.h @@ -211,7 +211,7 @@ #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h index 24f37e7cb2..b5820ceab1 100644 --- a/include/configs/MPC8323ERDB.h +++ b/include/configs/MPC8323ERDB.h @@ -156,7 +156,7 @@ #endif /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h index 669577ef10..c4acc05fe1 100644 --- a/include/configs/MPC832XEMDS.h +++ b/include/configs/MPC832XEMDS.h @@ -144,7 +144,7 @@ #endif /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h index ea5fbff305..63c6dbcad5 100644 --- a/include/configs/MPC8349EMDS.h +++ b/include/configs/MPC8349EMDS.h @@ -201,7 +201,7 @@ #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h index 9183d77948..068df57e0a 100644 --- a/include/configs/MPC8349ITX.h +++ b/include/configs/MPC8349ITX.h @@ -308,7 +308,7 @@ boards, we say we have two, but don't display a message if we find only one. */ #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h index 3497ba07e7..60c996841d 100644 --- a/include/configs/MPC8360EMDS.h +++ b/include/configs/MPC8360EMDS.h @@ -170,7 +170,7 @@ #endif /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h index 2b7d62954b..0205c99399 100644 --- a/include/configs/MPC837XERDB.h +++ b/include/configs/MPC837XERDB.h @@ -228,7 +228,7 @@ #undef CONFIG_SYS_RAMBOOT #endif -#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */ /* diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h index 19da1337e7..41dbd0d241 100644 --- a/include/configs/kmeter1.h +++ b/include/configs/kmeter1.h @@ -157,7 +157,7 @@ #undef CONFIG_SYS_RAMBOOT #endif -#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 256 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserved for malloc */ /*