mpc512x updates for current merge window
cover mpc512x updates for current merge window
Various cleanups, extensions and new support for ac14xx board
Anatolij Gustschin (8):
mpc512x: add common LAW and Chip Select configuration
mpc512x: use common code for CSx configuration
mpc512x: use common code for clock setting for all mpc512x boards
mpc512x: optionally configure DIU, LPC and NFC deviders
mpc512x: allow configuring board specific IPS divider
mpc512x: add ifm ac14xx board
mpc512x: Adjust the DRAM init sequence to the datasheet spec
mpc512x: pdm360ng: drop not needed memory node fixup
MAINTAINERS | 1 + arch/powerpc/cpu/mpc512x/cpu_init.c | 120 ++++++ arch/powerpc/cpu/mpc512x/fixed_sdram.c | 17 +- arch/powerpc/cpu/mpc512x/iopin.c | 54 +++ arch/powerpc/include/asm/immap_512x.h | 22 ++ board/davedenx/aria/aria.c | 64 ---- board/esd/mecp5123/mecp5123.c | 54 --- board/freescale/mpc5121ads/mpc5121ads.c | 52 --- board/ifm/ac14xx/Makefile | 34 ++ board/ifm/ac14xx/ac14xx.c | 617 +++++++++++++++++++++++++++++++ board/pdm360ng/pdm360ng.c | 58 --- boards.cfg | 1 + include/configs/ac14xx.h | 591 +++++++++++++++++++++++++++++ include/configs/aria.h | 23 ++- include/configs/mecp5123.h | 24 ++ include/configs/mpc5121ads.h | 23 ++ include/configs/pdm360ng.h | 24 ++- 17 files changed, 1548 insertions(+), 231 deletions(-) create mode 100644 board/ifm/ac14xx/Makefile create mode 100644 board/ifm/ac14xx/ac14xx.c create mode 100644 include/configs/ac14xx.h
Signature · 1 line
1.7.5.4
PATCH 1/8 mpc512x: add common LAW and Chip Select configuration
Currently each mpc512x board has its own LAW and CS config code, we should avoid this code duplication. Allow all boards to use common code by only defining LAW and CS config macros like CONFIG_SYS_CSx_START, CONFIG_SYS_CSx_SIZE and CONFIG_SYS_CSx_CFG.
Also allow common configuration of additional CS parameters by CONFIG_SYS_CS_ALETIMING, CONFIG_SYS_CS_BURST, CONFIG_SYS_CS_DEADCYCLE and CONFIG_SYS_CS_HOLDCYCLE options.
--- arch/powerpc/cpu/mpc512x/cpu_init.c | 96 +++++++++++++++++++++++++++++++++++ 1 files changed, 96 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc512x/cpu_init.c +96 -0
@@ -26,6 +26,7 @@#include <common.h> #include <asm/io.h> +#include <asm/mpc512x.h> #include <asm/processor.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -43,6 +44,101 @@ void cpu_init_f (volatile immap_t * im)/* Clear initial global data */ memset ((void *) gd,0 ,sizeof (gd_t)); +/* Local Window and chip select configuration */ +#if defined(CONFIG_SYS_CS0_START ) && defined(CONFIG_SYS_CS0_SIZE ) +out_be32 (&im->sysconf.lpcs0aw, +CSAW_START (CONFIG_SYS_CS0_START ) | +CSAW_STOP (CONFIG_SYS_CS0_START ,CONFIG_SYS_CS0_SIZE )); +sync_law (&im->sysconf.lpcs0aw); +#endif +#if defined(CONFIG_SYS_CS0_CFG ) +out_be32 (&im->lpc.cs_cfg[0 ],CONFIG_SYS_CS0_CFG ); +#endif + +#if defined(CONFIG_SYS_CS1_START ) && defined(CONFIG_SYS_CS1_SIZE ) +out_be32 (&im->sysconf.lpcs1aw, +CSAW_START (CONFIG_SYS_CS1_START ) | +CSAW_STOP (CONFIG_SYS_CS1_START ,CONFIG_SYS_CS1_SIZE )); +sync_law (&im->sysconf.lpcs1aw); +#endif +#if defined(CONFIG_SYS_CS1_CFG ) +out_be32 (&im->lpc.cs_cfg[1 ],CONFIG_SYS_CS1_CFG ); +#endif + +#if defined(CONFIG_SYS_CS2_START ) && (definedCONFIG_SYS_CS2_SIZE ) +out_be32 (&im->sysconf.lpcs2aw, +CSAW_START (CONFIG_SYS_CS2_START ) | +CSAW_STOP (CONFIG_SYS_CS2_START ,CONFIG_SYS_CS2_SIZE )); +sync_law (&im->sysconf.lpcs2aw); +#endif +#if defined(CONFIG_SYS_CS2_CFG ) +out_be32 (&im->lpc.cs_cfg[2 ],CONFIG_SYS_CS2_CFG ); +#endif + +#if defined(CONFIG_SYS_CS3_START ) && defined(CONFIG_SYS_CS3_SIZE ) +out_be32 (&im->sysconf.lpcs3aw, +CSAW_START (CONFIG_SYS_CS3_START ) | +CSAW_STOP (CONFIG_SYS_CS3_START ,CONFIG_SYS_CS3_SIZE )); +sync_law (&im->sysconf.lpcs3aw); +#endif +#if defined(CONFIG_SYS_CS3_CFG ) +out_be32 (&im->lpc.cs_cfg[3 ],CONFIG_SYS_CS3_CFG ); +#endif + +#if defined(CONFIG_SYS_CS4_START ) && defined(CONFIG_SYS_CS4_SIZE ) +out_be32 (&im->sysconf.lpcs4aw, +CSAW_START (CONFIG_SYS_CS4_START ) | +CSAW_STOP (CONFIG_SYS_CS4_START ,CONFIG_SYS_CS4_SIZE )); +sync_law (&im->sysconf.lpcs4aw); +#endif +#if defined(CONFIG_SYS_CS4_CFG ) +out_be32 (&im->lpc.cs_cfg[4 ],CONFIG_SYS_CS4_CFG ); +#endif + +#if defined(CONFIG_SYS_CS5_START ) && defined(CONFIG_SYS_CS5_SIZE ) +out_be32 (&im->sysconf.lpcs5aw, +CSAW_START (CONFIG_SYS_CS5_START ) | +CSAW_STOP (CONFIG_SYS_CS5_START ,CONFIG_SYS_CS5_SIZE )); +sync_law (&im->sysconf.lpcs5aw); +#endif +#if defined(CONFIG_SYS_CS5_CFG ) +out_be32 (&im->lpc.cs_cfg[5 ],CONFIG_SYS_CS5_CFG ); +#endif + +#if defined(CONFIG_SYS_CS6_START ) && defined(CONFIG_SYS_CS6_SIZE ) +out_be32 (&im->sysconf.lpcs6aw, +CSAW_START (CONFIG_SYS_CS6_START ) | +CSAW_STOP (CONFIG_SYS_CS6_START ,CONFIG_SYS_CS6_SIZE )); +sync_law (&im->sysconf.lpcs6aw); +#endif +#if defined(CONFIG_SYS_CS6_CFG ) +out_be32 (&im->lpc.cs_cfg[6 ],CONFIG_SYS_CS6_CFG ); +#endif + +#if defined(CONFIG_SYS_CS7_START ) && defined(CONFIG_SYS_CS7_SIZE ) +out_be32 (&im->sysconf.lpcs7aw, +CSAW_START (CONFIG_SYS_CS7_START ) | +CSAW_STOP (CONFIG_SYS_CS7_START ,CONFIG_SYS_CS7_SIZE )); +sync_law (&im->sysconf.lpcs7aw); +#endif +#if defined(CONFIG_SYS_CS7_CFG ) +out_be32 (&im->lpc.cs_cfg[7 ],CONFIG_SYS_CS7_CFG ); +#endif + +#if definedCONFIG_SYS_CS_ALETIMING +if (SVR_MJREV (in_be32 (&im->sysconf.spridr)) >=2 ) +out_be32 (&im->lpc.altr,CONFIG_SYS_CS_ALETIMING ); +#endif +#if definedCONFIG_SYS_CS_BURST +out_be32 (&im->lpc.cs_bcr,CONFIG_SYS_CS_BURST ); +#endif +#if definedCONFIG_SYS_CS_DEADCYCLE +out_be32 (&im->lpc.cs_dccr,CONFIG_SYS_CS_DEADCYCLE ); +#endif +#if definedCONFIG_SYS_CS_HOLDCYCLE +out_be32 (&im->lpc.cs_hccr,CONFIG_SYS_CS_HOLDCYCLE ); +#endif +/* system performance tweaking */ #ifdef CONFIG_SYS_ACR_PIPE_DEP
Signature · 1 line
1.7.5.4
PATCH 1/8 mpc512x: add common LAW and Chip Select configuration
Dear Anatolij Gustschin,
Quoted 5 lines · In message <[email protected]> you wrote:
Currently each mpc512x board has its own LAW and CS config code, we should avoid this code duplication. Allow all boards to use common code by only defining LAW and CS config macros like
CONFIG_SYS_CSx_START,CONFIG_SYS_CSx_SIZEandCONFIG_SYS_CSx_CFG.
Quoted 8 lines
Also allow common configuration of additional CS parameters by
CONFIG_SYS_CS_ALETIMING,CONFIG_SYS_CS_BURST,CONFIG_SYS_CS_DEADCYCLEandCONFIG_SYS_CS_HOLDCYCLEoptions.Signed-off-by Anatolij Gustschin <[email protected]>--- arch/powerpc/cpu/mpc512x/cpu_init.c | 96 +++++++++++++++++++++++++++++++++++ 1 files changed, 96 insertions(+), 0 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
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 at denx.de Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Albert Einstein
PATCH 2/8 mpc512x: use common code for CSx configuration
In reply to Anatolij GustschinRemove CSx configurations from board code and only define required CSx macros in the board config file to configure chip select windows and parameters.
--- board/davedenx/aria/aria.c | 31 ------------------------------- board/esd/mecp5123/mecp5123.c | 31 ------------------------------- board/freescale/mpc5121ads/mpc5121ads.c | 21 --------------------- board/pdm360ng/pdm360ng.c | 26 -------------------------- include/configs/aria.h | 5 +++++ include/configs/mecp5123.h | 7 +++++++ include/configs/mpc5121ads.h | 2 ++ include/configs/pdm360ng.h | 6 ++++++ 8 files changed, 20 insertions(+), 109 deletions(-)
board/davedenx/aria/aria.c +0 -31
@@ -55,37 +55,6 @@ DECLARE_GLOBAL_DATA_PTR;int board_early_init_f (void ) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -u32 spridr; - -/* -* Initialize Local Window for the On Board FPGA access -*/ -out_be32 (&im->sysconf.lpcs2aw, -CSAW_START (CONFIG_SYS_ARIA_FPGA_BASE ) | -CSAW_STOP (CONFIG_SYS_ARIA_FPGA_BASE ,CONFIG_SYS_ARIA_FPGA_SIZE ) - ); -out_be32 (&im->lpc.cs_cfg[2 ],CONFIG_SYS_CS2_CFG ); -sync_law (&im->sysconf.lpcs2aw); - -/* -* Initialize Local Window for the On Board SRAM access -*/ -out_be32 (&im->sysconf.lpcs6aw, -CSAW_START (CONFIG_SYS_ARIA_SRAM_BASE ) | -CSAW_STOP (CONFIG_SYS_ARIA_SRAM_BASE ,CONFIG_SYS_ARIA_SRAM_SIZE ) - ); -out_be32 (&im->lpc.cs_cfg[6 ],CONFIG_SYS_CS6_CFG ); -sync_law (&im->sysconf.lpcs6aw); - -/* -* Configure Flash Speed -*/ -out_be32 (&im->lpc.cs_cfg[0 ],CONFIG_SYS_CS0_CFG ); - - spridr =in_be32 (&im->sysconf.spridr); - -if (SVR_MJREV (spridr) >=2 ) -out_be32 (&im->lpc.altr,CONFIG_SYS_CS_ALETIMING );/* * Enable clocks
board/esd/mecp5123/mecp5123.c +0 -31
@@ -65,18 +65,9 @@ int eeprom_write_enable(unsigned dev_addr, int state)int board_early_init_f (void ) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -u32 spridr;int i;/* -* Initialize Local Window for NOR FLASH access -*/ -out_be32 (&im->sysconf.lpcs0aw, -CSAW_START (CONFIG_SYS_FLASH_BASE ) | -CSAW_STOP (CONFIG_SYS_FLASH_BASE ,CONFIG_SYS_FLASH_SIZE )); -sync_law (&im->sysconf.lpcs0aw); - -/* * Initialize Local Window for boot access */ out_be32(&im->sysconf.lpbaw,
@@ -84,28 +75,6 @@ int board_early_init_f(void)sync_law (&im->sysconf.lpbaw);/* -* Initialize Local Window for VPC3 access -*/ -out_be32 (&im->sysconf.lpcs1aw, -CSAW_START (CONFIG_SYS_VPC3_BASE ) | -CSAW_STOP (CONFIG_SYS_VPC3_BASE ,CONFIG_SYS_VPC3_SIZE )); -sync_law (&im->sysconf.lpcs1aw); - -/* -* Configure Flash Speed -*/ -out_be32 (&im->lpc.cs_cfg[0 ],CONFIG_SYS_CS0_CFG ); - -/* -* Configure VPC3 Speed -*/ -out_be32 (&im->lpc.cs_cfg[1 ],CONFIG_SYS_CS1_CFG ); - - spridr =in_be32 (&im->sysconf.spridr); -if (SVR_MJREV (spridr) >=2 ) -out_be32 (&im->lpc.altr,CONFIG_SYS_CS_ALETIMING ); - -/* * Enable clocks */ out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN );
board/freescale/mpc5121ads/mpc5121ads.c +0 -21
@@ -84,18 +84,6 @@ void mpc5121_nfc_select_chip(struct mtd_info *mtd, int chip)int board_early_init_f (void ) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -u32 spridr; - -/* -* Initialize Local Window for the CPLD registers access (CS2 selects -* the CPLD chip) -*/ -out_be32 (&im->sysconf.lpcs2aw, -CSAW_START (CONFIG_SYS_CPLD_BASE ) | -CSAW_STOP (CONFIG_SYS_CPLD_BASE ,CONFIG_SYS_CPLD_SIZE ) - ); -out_be32 (&im->lpc.cs_cfg[2 ],CONFIG_SYS_CS2_CFG ); -sync_law (&im->sysconf.lpcs2aw);/* * Disable Boot NOR FLASH write protect - CPLD Reg 8 NOR FLASH Control
@@ -114,15 +102,6 @@ int board_early_init_f(void) out_8((u8 *)(CONFIG_SYS_CPLD_BASE + 0x08), 0x32); }#endif -/* -* Configure Flash Speed -*/ -out_be32 (&im->lpc.cs_cfg[0 ],CONFIG_SYS_CS0_CFG ); - - spridr =in_be32 (&im->sysconf.spridr); - -if (SVR_MJREV (spridr) >=2 ) -out_be32 (&im->lpc.altr,CONFIG_SYS_CS_ALETIMING );/* * Enable clocks
board/pdm360ng/pdm360ng.c +0 -26
@@ -64,32 +64,6 @@ int board_early_init_f(void)volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ;/* -* Initialize Local Window for FLASH-Bank1 access (CS1) -*/ -out_be32 (&im->sysconf.lpcs1aw, -CSAW_START (CONFIG_SYS_FLASH1_BASE ) | -CSAW_STOP (CONFIG_SYS_FLASH1_BASE ,CONFIG_SYS_FLASH_SIZE ) - ); -out_be32 (&im->lpc.cs_cfg[1 ],CONFIG_SYS_CS1_CFG ); - -/* -* Local Window for MRAM access (CS2) -*/ -out_be32 (&im->sysconf.lpcs2aw, -CSAW_START (CONFIG_SYS_MRAM_BASE ) | -CSAW_STOP (CONFIG_SYS_MRAM_BASE ,CONFIG_SYS_MRAM_SIZE ) - ); -out_be32 (&im->lpc.cs_cfg[2 ],CONFIG_SYS_CS2_CFG ); - -sync_law (&im->sysconf.lpcs2aw); - -/* -* Configure Flash Speed -*/ -out_be32 (&im->lpc.cs_cfg[0 ],CONFIG_SYS_CS0_CFG ); -out_be32 (&im->lpc.altr,CONFIG_SYS_CS_ALETIMING ); - -/* * Enable clocks */ out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN );
include/configs/aria.h +5 -0
@@ -266,11 +266,16 @@#define CONFIG_SYS_ARIA_SRAM_BASE (CONFIG_SYS_SRAM_BASE + \ CONFIG_SYS_SRAM_SIZE)#define CONFIG_SYS_ARIA_SRAM_SIZE 0x00100000/* reserve 1MB-window */ +#define CONFIG_SYS_CS6_START CONFIG_SYS_ARIA_SRAM_BASE +#define CONFIG_SYS_CS6_SIZE CONFIG_SYS_ARIA_SRAM_SIZE#define CONFIG_SYS_ARIA_FPGA_BASE (CONFIG_SYS_ARIA_SRAM_BASE + \ CONFIG_SYS_ARIA_SRAM_SIZE)#define CONFIG_SYS_ARIA_FPGA_SIZE 0x20000/* 128 KB */ +#define CONFIG_SYS_CS2_START CONFIG_SYS_ARIA_FPGA_BASE +#define CONFIG_SYS_CS2_SIZE CONFIG_SYS_ARIA_FPGA_SIZE +#define CONFIG_SYS_CS0_CFG 0x05059150#define CONFIG_SYS_CS2_CFG ( (5 << 24) | \ (5 << 16) | \
include/configs/mecp5123.h +7 -0
@@ -191,6 +191,10 @@#define CONFIG_SYS_SRAM_BASE 0x30000000#define CONFIG_SYS_SRAM_SIZE 0x00020000/* 128 KB */ +/* Initialize Local Window for NOR FLASH access */ +#define CONFIG_SYS_CS0_START CONFIG_SYS_FLASH_BASE +#define CONFIG_SYS_CS0_SIZE CONFIG_SYS_FLASH_SIZE +/* ALE active low, data size 4bytes */ #define CONFIG_SYS_CS0_CFG 0x05051150
@@ -201,6 +205,9 @@#define CONFIG_SYS_CS1_CFG 0x1f1f3090#define CONFIG_SYS_VPC3_BASE 0x82000000/* start of VPC3 space */ #define CONFIG_SYS_VPC3_SIZE 0x00010000/* max VPC3 size */ +/* Initialize Local Window for VPC3 access */ +#define CONFIG_SYS_CS1_START CONFIG_SYS_VPC3_BASE +#define CONFIG_SYS_CS1_SIZE CONFIG_SYS_VPC3_SIZE/* Use SRAM for initial stack */ #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_SRAM_BASE/* Init RAM addr */
include/configs/mpc5121ads.h +2 -0
@@ -258,6 +258,8 @@*/ #define CONFIG_SYS_CPLD_BASE 0x82000000#define CONFIG_SYS_CPLD_SIZE 0x00010000/* 64 KB */ +#define CONFIG_SYS_CS2_START CONFIG_SYS_CPLD_BASE +#define CONFIG_SYS_CS2_SIZE CONFIG_SYS_CPLD_SIZE#define CONFIG_SYS_SRAM_BASE 0x30000000#define CONFIG_SYS_SRAM_SIZE 0x00020000/* 128 KB */
include/configs/pdm360ng.h +6 -0
@@ -206,6 +206,9 @@#define CONFIG_SYS_SRAM_BASE 0x50000000#define CONFIG_SYS_SRAM_SIZE 0x00020000/* 128 KB */ +#define CONFIG_SYS_CS1_START CONFIG_SYS_FLASH1_BASE +#define CONFIG_SYS_CS1_SIZE CONFIG_SYS_FLASH_SIZE +/* ALE active low, data size 4 bytes */ #define CONFIG_SYS_CS0_CFG 0x05059350/* ALE active low, data size 4 bytes */
@@ -213,6 +216,9 @@#define CONFIG_SYS_MRAM_BASE 0x50040000#define CONFIG_SYS_MRAM_SIZE 0x00020000 +#define CONFIG_SYS_CS2_START CONFIG_SYS_MRAM_BASE +#define CONFIG_SYS_CS2_SIZE CONFIG_SYS_MRAM_SIZE +/* ALE active low, data size 4 bytes */ #define CONFIG_SYS_CS2_CFG 0x05059110
Signature · 1 line
1.7.5.4
PATCH 2/8 mpc512x: use common code for CSx configuration
Dear Anatolij Gustschin,
Quoted 7 lines · In message <[email protected]> you wrote:
Remove CSx configurations from board code and only define required CSx macros in the board config file to configure chip select windows and parameters.
Signed-off-by Anatolij Gustschin <[email protected]>Cc Reinhard Arlt <[email protected]>Cc Wolfgang Denk <[email protected]>
Quoted 10 lines
--- board/davedenx/aria/aria.c | 31 ------------------------------- board/esd/mecp5123/mecp5123.c | 31 ------------------------------- board/freescale/mpc5121ads/mpc5121ads.c | 21 --------------------- board/pdm360ng/pdm360ng.c | 26 -------------------------- include/configs/aria.h | 5 +++++ include/configs/mecp5123.h | 7 +++++++ include/configs/mpc5121ads.h | 2 ++ include/configs/pdm360ng.h | 6 ++++++ 8 files changed, 20 insertions(+), 109 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
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 at denx.de To be sure of hitting the target, shoot first and, whatever you hit, call it the target.
PATCH 3/8 mpc512x: use common code for clock setting for all mpc512x boards
In reply to Anatolij GustschinOnly define enabled clocks in the config file and enable the clocks in common code.
--- arch/powerpc/cpu/mpc512x/cpu_init.c | 9 ++++++++ board/davedenx/aria/aria.c | 33 ------------------------------- board/esd/mecp5123/mecp5123.c | 23 --------------------- board/freescale/mpc5121ads/mpc5121ads.c | 31 ----------------------------- board/pdm360ng/pdm360ng.c | 31 ----------------------------- include/configs/aria.h | 18 ++++++++++++++++- include/configs/mecp5123.h | 17 ++++++++++++++++ include/configs/mpc5121ads.h | 21 +++++++++++++++++++ include/configs/pdm360ng.h | 18 ++++++++++++++++- 9 files changed, 81 insertions(+), 120 deletions(-)
arch/powerpc/cpu/mpc512x/cpu_init.c +9 -0
@@ -180,6 +180,15 @@ void cpu_init_f (volatile immap_t * im)* during FLASH chip identification etc. */ setbits_be32 (&im->sysconf.spcr,SPCR_TBEN ); + +/* +* Enable clocks +*/ +out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN ); +out_be32 (&im->clk.sccr[1 ],SCCR2_CLOCKS_EN ); +#if defined(CONFIG_IIM ) || defined(CONFIG_CMD_FUSE ) +setbits_be32 (&im->clk.sccr[1 ],CLOCK_SCCR2_IIM_EN ); +#endif }int cpu_init_r (void )
board/davedenx/aria/aria.c +0 -33
@@ -35,39 +35,6 @@DECLARE_GLOBAL_DATA_PTR ; -/* Clocks in use */ -#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ - CLOCK_SCCR1_LPC_EN | \ - CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ - CLOCK_SCCR1_PSCFIFO_EN | \ - CLOCK_SCCR1_DDR_EN | \ - CLOCK_SCCR1_FEC_EN | \ - CLOCK_SCCR1_NFC_EN | \ - CLOCK_SCCR1_PATA_EN | \ - CLOCK_SCCR1_PCI_EN | \ - CLOCK_SCCR1_TPR_EN) - -#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \ - CLOCK_SCCR2_SPDIF_EN | \ - CLOCK_SCCR2_DIU_EN | \ - CLOCK_SCCR2_I2C_EN) - -int board_early_init_f (void ) -{ -volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; - -/* -* Enable clocks -*/ -out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN ); -out_be32 (&im->clk.sccr[1 ],SCCR2_CLOCKS_EN ); -#if defined(CONFIG_IIM ) || defined(CONFIG_CMD_FUSE ) -setbits_be32 (&im->clk.sccr[1 ],CLOCK_SCCR2_IIM_EN ); -#endif - -return 0 ; -} -phys_size_t initdram (int board_type) {return fixed_sdram (NULL ,NULL ,0 );
board/esd/mecp5123/mecp5123.c +0 -23
@@ -33,20 +33,6 @@DECLARE_GLOBAL_DATA_PTR ; -/* Clocks in use */ -#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ - CLOCK_SCCR1_LPC_EN | \ - CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ - CLOCK_SCCR1_PSCFIFO_EN | \ - CLOCK_SCCR1_DDR_EN | \ - CLOCK_SCCR1_FEC_EN | \ - CLOCK_SCCR1_NFC_EN | \ - CLOCK_SCCR1_PCI_EN | \ - CLOCK_SCCR1_TPR_EN) - -#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \ - CLOCK_SCCR2_I2C_EN) -int eeprom_write_enable (unsigned dev_addr,int state) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ;
@@ -75,15 +61,6 @@ int board_early_init_f(void)sync_law (&im->sysconf.lpbaw);/* -* Enable clocks -*/ -out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN ); -out_be32 (&im->clk.sccr[1 ],SCCR2_CLOCKS_EN ); -#if defined(CONFIG_IIM ) || defined(CONFIG_CMD_FUSE ) -setbits_be32 (&im->clk.sccr[1 ],CLOCK_SCCR2_IIM_EN ); -#endif - -/* * Configure MSCAN clocks */ for (i=0 ; i<4 ; ++i) {
board/freescale/mpc5121ads/mpc5121ads.c +0 -31
@@ -38,25 +38,6 @@DECLARE_GLOBAL_DATA_PTR ; -/* Clocks in use */ -#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ - CLOCK_SCCR1_DDR_EN | \ - CLOCK_SCCR1_FEC_EN | \ - CLOCK_SCCR1_LPC_EN | \ - CLOCK_SCCR1_NFC_EN | \ - CLOCK_SCCR1_PATA_EN | \ - CLOCK_SCCR1_PCI_EN | \ - CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ - CLOCK_SCCR1_PSCFIFO_EN | \ - CLOCK_SCCR1_TPR_EN) - -#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_DIU_EN | \ - CLOCK_SCCR2_I2C_EN | \ - CLOCK_SCCR2_MEM_EN | \ - CLOCK_SCCR2_SPDIF_EN | \ - CLOCK_SCCR2_USB1_EN | \ - CLOCK_SCCR2_USB2_EN) -void __mpc5121_nfc_select_chip (struct mtd_info *mtd,int chip);/* Active chip number set in board_nand_select_device() (mpc5121_nfc.c) */
@@ -83,8 +64,6 @@ void mpc5121_nfc_select_chip(struct mtd_info *mtd, int chip)int board_early_init_f (void ) { -volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -/* * Disable Boot NOR FLASH write protect - CPLD Reg 8 NOR FLASH Control *
@@ -102,16 +81,6 @@ int board_early_init_f(void) out_8((u8 *)(CONFIG_SYS_CPLD_BASE + 0x08), 0x32); }#endif - -/* -* Enable clocks -*/ -out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN ); -out_be32 (&im->clk.sccr[1 ],SCCR2_CLOCKS_EN ); -#if defined(CONFIG_IIM ) || defined(CONFIG_CMD_FUSE ) -setbits_be32 (&im->clk.sccr[1 ],CLOCK_SCCR2_IIM_EN ); -#endif -return 0 ; }
board/pdm360ng/pdm360ng.c +0 -31
@@ -44,37 +44,6 @@ DECLARE_GLOBAL_DATA_PTR;extern flash_info_t flash_info[];ulong flash_get_size (phys_addr_t base,int banknum); -/* Clocks in use */ -#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ - CLOCK_SCCR1_LPC_EN | \ - CLOCK_SCCR1_NFC_EN | \ - CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ - CLOCK_SCCR1_PSCFIFO_EN | \ - CLOCK_SCCR1_DDR_EN | \ - CLOCK_SCCR1_FEC_EN | \ - CLOCK_SCCR1_TPR_EN) - -#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \ - CLOCK_SCCR2_SPDIF_EN | \ - CLOCK_SCCR2_DIU_EN | \ - CLOCK_SCCR2_I2C_EN) - -int board_early_init_f (void ) -{ -volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; - -/* -* Enable clocks -*/ -out_be32 (&im->clk.sccr[0 ],SCCR1_CLOCKS_EN ); -out_be32 (&im->clk.sccr[1 ],SCCR2_CLOCKS_EN ); -#if defined(CONFIG_IIM ) || defined(CONFIG_CMD_FUSE ) -setbits_be32 (&im->clk.sccr[1 ],CLOCK_SCCR2_IIM_EN ); -#endif - -return 0 ; -} -sdram_conf_t mddrc_config[] = { { (512 <<20 ),/* 512 MB RAM configuration */
include/configs/aria.h +17 -1
@@ -64,7 +64,6 @@#define CONFIG_SYS_MPC512X_CLKIN 33000000/* in Hz */ -#define CONFIG_BOARD_EARLY_INIT_F /* call board_early_init_f() */ #define CONFIG_MISC_INIT_R #define CONFIG_SYS_IMMR 0x80000000
@@ -648,4 +647,21 @@#define FSL_ATA_CTRL_DMA_WRITE 0x02000000#define FSL_ATA_CTRL_IORDY_EN 0x01000000 +/* Clocks in use */ +#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ + CLOCK_SCCR1_LPC_EN | \ + CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ + CLOCK_SCCR1_PSCFIFO_EN | \ + CLOCK_SCCR1_DDR_EN | \ + CLOCK_SCCR1_FEC_EN | \ + CLOCK_SCCR1_NFC_EN | \ + CLOCK_SCCR1_PATA_EN | \ + CLOCK_SCCR1_PCI_EN | \ + CLOCK_SCCR1_TPR_EN) + +#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \ + CLOCK_SCCR2_SPDIF_EN | \ + CLOCK_SCCR2_DIU_EN | \ + CLOCK_SCCR2_I2C_EN) +#endif /* __CONFIG_H */
include/configs/mecp5123.h +17 -0
@@ -242,6 +242,23 @@#define CONSOLE_FIFO_RX_SIZE FIFOC_PSC3_RX_SIZE#define CONSOLE_FIFO_RX_ADDR FIFOC_PSC3_RX_ADDR +/* +* Clocks in use +*/ +#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ + CLOCK_SCCR1_LPC_EN | \ + CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ + CLOCK_SCCR1_PSCFIFO_EN | \ + CLOCK_SCCR1_DDR_EN | \ + CLOCK_SCCR1_FEC_EN | \ + CLOCK_SCCR1_NFC_EN | \ + CLOCK_SCCR1_PCI_EN | \ + CLOCK_SCCR1_TPR_EN) + +#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \ + CLOCK_SCCR2_I2C_EN) + +#define CONFIG_CMDLINE_EDITING 1/* add command line history */ /* Use the HUSH parser */ #define CONFIG_SYS_HUSH_PARSER
include/configs/mpc5121ads.h +21 -0
@@ -312,6 +312,27 @@#endif /* +* Clocks in use +*/ +#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ + CLOCK_SCCR1_DDR_EN | \ + CLOCK_SCCR1_FEC_EN | \ + CLOCK_SCCR1_LPC_EN | \ + CLOCK_SCCR1_NFC_EN | \ + CLOCK_SCCR1_PATA_EN | \ + CLOCK_SCCR1_PCI_EN | \ + CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ + CLOCK_SCCR1_PSCFIFO_EN | \ + CLOCK_SCCR1_TPR_EN) + +#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_DIU_EN | \ + CLOCK_SCCR2_I2C_EN | \ + CLOCK_SCCR2_MEM_EN | \ + CLOCK_SCCR2_SPDIF_EN | \ + CLOCK_SCCR2_USB1_EN | \ + CLOCK_SCCR2_USB2_EN) + +/* * PCI */ #ifdef CONFIG_PCI
include/configs/pdm360ng.h +17 -1
@@ -68,7 +68,6 @@#define CONFIG_SYS_MPC512X_CLKIN 33333333/* in Hz */ -#define CONFIG_BOARD_EARLY_INIT_F /* call board_early_init_f() */ #define CONFIG_MISC_INIT_R #define CONFIG_SYS_IMMR 0x80000000
@@ -302,6 +301,23 @@#define CONSOLE_FIFO_RX_ADDR FIFOC_PSC6_RX_ADDR/* +* Clocks in use +*/ +#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \ + CLOCK_SCCR1_LPC_EN | \ + CLOCK_SCCR1_NFC_EN | \ + CLOCK_SCCR1_PSC_EN(CONFIG_PSC_CONSOLE) | \ + CLOCK_SCCR1_PSCFIFO_EN | \ + CLOCK_SCCR1_DDR_EN | \ + CLOCK_SCCR1_FEC_EN | \ + CLOCK_SCCR1_TPR_EN) + +#define SCCR2_CLOCKS_EN (CLOCK_SCCR2_MEM_EN | \ + CLOCK_SCCR2_SPDIF_EN | \ + CLOCK_SCCR2_DIU_EN | \ + CLOCK_SCCR2_I2C_EN) + +/* * Used PSC UART devices */ #define CONFIG_SYS_PSC1
Signature · 1 line
1.7.5.4
PATCH 3/8 mpc512x: use common code for clock setting for all mpc512x boards
Dear Anatolij Gustschin,
Quoted 6 lines · In message <[email protected]> you wrote:
Only define enabled clocks in the config file and enable the clocks in common code.
Signed-off-by Anatolij Gustschin <[email protected]>Cc Reinhard Arlt <[email protected]>Cc Wolfgang Denk <[email protected]>
Quoted 11 lines
--- arch/powerpc/cpu/mpc512x/cpu_init.c | 9 ++++++++ board/davedenx/aria/aria.c | 33 ------------------------------- board/esd/mecp5123/mecp5123.c | 23 --------------------- board/freescale/mpc5121ads/mpc5121ads.c | 31 ----------------------------- board/pdm360ng/pdm360ng.c | 31 ----------------------------- include/configs/aria.h | 18 ++++++++++++++++- include/configs/mecp5123.h | 17 ++++++++++++++++ include/configs/mpc5121ads.h | 21 +++++++++++++++++++ include/configs/pdm360ng.h | 18 ++++++++++++++++- 9 files changed, 81 insertions(+), 120 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 at denx.de If all the Chinese simultaneously jumped into the Pacific off a 10 foot platform erected 10 feet off their coast, it would cause a tidal wave that would destroy everything in this country west of Nebraska.
PATCH 4/8 mpc512x: optionally configure DIU, LPC and NFC deviders
In reply to Anatolij GustschinIf a board config file defines DIU, LPC and NFC deviders, configure them in the SCFR1 register.
--- arch/powerpc/cpu/mpc512x/cpu_init.c | 15 +++++++++++++++ arch/powerpc/include/asm/immap_512x.h | 6 ++++++ 2 files changed, 21 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc512x/cpu_init.c +15 -0
@@ -172,6 +172,21 @@ void cpu_init_f (volatile immap_t * im) ips_div |=SCFR1_IPS_DIV <<SCFR1_IPS_DIV_SHIFT ;out_be32 (&im->clk.scfr[0 ], ips_div); +#ifdef SCFR1_LPC_DIV +clrsetbits_be32 (&im->clk.scfr[0 ],SCFR1_LPC_DIV_MASK , +SCFR1_LPC_DIV <<SCFR1_LPC_DIV_SHIFT ); +#endif + +#ifdef SCFR1_NFC_DIV +clrsetbits_be32 (&im->clk.scfr[0 ],SCFR1_NFC_DIV_MASK , +SCFR1_NFC_DIV <<SCFR1_NFC_DIV_SHIFT ); +#endif + +#ifdef SCFR1_DIU_DIV +clrsetbits_be32 (&im->clk.scfr[0 ],SCFR1_DIU_DIV_MASK , +SCFR1_DIU_DIV <<SCFR1_DIU_DIV_SHIFT ); +#endif +/* * Enable Time Base/Decrementer *
arch/powerpc/include/asm/immap_512x.h +6 -0
@@ -238,6 +238,12 @@ typedef struct clk512x {#define SCFR1_LPC_DIV_MASK 0x00003800#define SCFR1_LPC_DIV_SHIFT 11 +#define SCFR1_NFC_DIV_MASK 0x00000700 +#define SCFR1_NFC_DIV_SHIFT 8 + +#define SCFR1_DIU_DIV_MASK 0x000000FF +#define SCFR1_DIU_DIV_SHIFT 0 +/* SCFR2 System Clock Frequency Register 2 */ #define SCFR2_SYS_DIV 0xFC000000#define SCFR2_SYS_DIV_SHIFT 26
Signature · 1 line
1.7.5.4
PATCH 4/8 mpc512x: optionally configure DIU, LPC and NFC deviders
Dear Anatolij Gustschin,
Quoted 8 lines · In message <[email protected]> you wrote:
If a board config file defines DIU, LPC and NFC deviders, configure them in the SCFR1 register.
Signed-off-by Anatolij Gustschin <[email protected]>--- arch/powerpc/cpu/mpc512x/cpu_init.c | 15 +++++++++++++++ arch/powerpc/include/asm/immap_512x.h | 6 ++++++ 2 files changed, 21 insertions(+), 0 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
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 at denx.de When the tide of life turns against you And the current upsets your boat Don't waste tears on what might have been Just lie on your back and float.
PATCH 5/8 mpc512x: allow configuring board specific IPS divider
In reply to Anatolij GustschinBoards may define own IPS divider in the config file if the default IPS divider doesn't fit their needs.
--- arch/powerpc/include/asm/immap_512x.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/immap_512x.h +2 -0
@@ -227,7 +227,9 @@ typedef struct clk512x {#define CLOCK_SCCR2_IIM_EN 0x00080000/* SCFR1 System Clock Frequency Register 1 */ +#ifndef SCFR1_IPS_DIV #define SCFR1_IPS_DIV 0x3 +#endif #define SCFR1_IPS_DIV_MASK 0x03800000#define SCFR1_IPS_DIV_SHIFT 23
Signature · 1 line
1.7.5.4
PATCH 5/8 mpc512x: allow configuring board specific IPS divider
Dear Anatolij Gustschin,
Quoted 7 lines · In message <[email protected]> you wrote:
Boards may define own IPS divider in the config file if the default IPS divider doesn't fit their needs.
Signed-off-by Anatolij Gustschin <[email protected]>--- arch/powerpc/include/asm/immap_512x.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
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 at denx.de ######## This message was made from 100% recycled electrons. ########
PATCH 6/8 mpc512x: add ifm ac14xx board
In reply to Anatolij GustschinAdd new mpc5121e based ac14xx board and a new pinmux config function for setting individual pinmux bit groups. This function is used in ac14xx board code.
--- MAINTAINERS | 1 + arch/powerpc/cpu/mpc512x/iopin.c | 54 +++ arch/powerpc/include/asm/immap_512x.h | 13 + board/ifm/ac14xx/Makefile | 34 ++ board/ifm/ac14xx/ac14xx.c | 617 +++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/ac14xx.h | 591 +++++++++++++++++++++++++++++++ 7 files changed, 1311 insertions(+), 0 deletions(-) create mode 100644 board/ifm/ac14xx/Makefile create mode 100644 board/ifm/ac14xx/ac14xx.c create mode 100644 include/configs/ac14xx.h
MAINTAINERS +1 -0
@@ -230,6 +230,7 @@ Wolfgang Grandegger <[email protected]> Anatolij Gustschin <[email protected]> + ac14xx MPC5121e O2D MPC5200 O2D300 MPC5200 O2DNT2 MPC5200
arch/powerpc/cpu/mpc512x/iopin.c +54 -0
57 lines not on this page · raw message
arch/powerpc/include/asm/immap_512x.h +13 -0
@@ -879,6 +879,19 @@ typedef struct iopin_t {void iopin_initialize (iopin_t *,int );/* +* support to adjust individual parts of the IO pin setup +*/ + +#define IO_PIN_OVER_EACH (1 << 0)/* for compatibility */ +#define IO_PIN_OVER_FMUX (1 << 1) +#define IO_PIN_OVER_HOLD (1 << 2) +#define IO_PIN_OVER_PULL (1 << 3) +#define IO_PIN_OVER_STRIG (1 << 4) +#define IO_PIN_OVER_DRVSTR (1 << 5) + +void iopin_initialize_bits (iopin_t *,int ); + +/* * IIM */ typedef struct iim512x {
board/ifm/ac14xx/Makefile new file +34 -0
@@ -0,0 +1,34 @@ +# +# (C) Copyright 2009 Wolfgang Denk <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +COBJS := $(COBJS-y) +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
board/ifm/ac14xx/ac14xx.c new file +617 -0
617 lines not on this page · raw message
boards.cfg +1 -0
@@ -475,6 +475,7 @@ aria powerpc mpc512x - daveden mecp5123 powerpc mpc512x - esd mpc5121ads powerpc mpc512x mpc5121ads freescale mpc5121ads_rev2 powerpc mpc512x mpc5121ads freescale - mpc5121ads:MPC5121ADS_REV2 +ac14xx powerpc mpc512x ac14xx ifm cmi_mpc5xx powerpc mpc5xx cmi PATI powerpc mpc5xx pati mpl a3m071 powerpc mpc5xxx a3m071
include/configs/ac14xx.h new file +591 -0
591 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 6/8 mpc512x: add ifm ac14xx board
Dear Anatolij Gustschin,
Quoted 5 lines · In message <[email protected]> you wrote:
Add new mpc5121e based ac14xx board and a new pinmux config function for setting individual pinmux bit groups. This function is used in ac14xx board code.
Signed-off-by Anatolij Gustschin <[email protected]>
Quoted 12 lines
--- MAINTAINERS | 1 + arch/powerpc/cpu/mpc512x/iopin.c | 54 +++ arch/powerpc/include/asm/immap_512x.h | 13 + board/ifm/ac14xx/Makefile | 34 ++ board/ifm/ac14xx/ac14xx.c | 617 +++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/ac14xx.h | 591 +++++++++++++++++++++++++++++++ 7 files changed, 1311 insertions(+), 0 deletions(-) create mode 100644 board/ifm/ac14xx/Makefile create mode 100644 board/ifm/ac14xx/ac14xx.c create mode 100644 include/configs/ac14xx.h
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
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 at denx.de I paid too much for it, but its worth it.
PATCH 7/8 mpc512x: Adjust the DRAM init sequence to the datasheet spec
In reply to Anatolij GustschinDo maintain a 200 usecs period of stable power and clock before asserting the CKE signal and sending commands, have at least 200 DRAM clock cycles pass after initialization before data access.
--- arch/powerpc/cpu/mpc512x/fixed_sdram.c | 17 ++++++++++++++++- arch/powerpc/include/asm/immap_512x.h | 1 + 2 files changed, 17 insertions(+), 1 deletions(-)
arch/powerpc/cpu/mpc512x/fixed_sdram.c +16 -1
@@ -99,7 +99,19 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config,sync_law (&im->sysconf.ddrlaw.ar);/* DDR Enable */ -out_be32 (&im->mddrc.ddr_sys_config,MDDRC_SYS_CFG_EN ); +/* +* the "enable" combination: DRAM controller out of reset, +* clock enabled, command mode -- BUT leave CKE low for now +*/ + i =MDDRC_SYS_CFG_EN & ~MDDRC_SYS_CFG_CKE_MASK ; +out_be32 (&im->mddrc.ddr_sys_config, i); +/* maintain 200 microseconds of stable power and clock */ +udelay (200 ); +/* apply a NOP, it shouldn't harm */ +out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_DDRCMD_NOP ); +/* now assert CKE (high) */ + i |=MDDRC_SYS_CFG_CKE_MASK ; +out_be32 (&im->mddrc.ddr_sys_config, i);/* Initialize DDR Priority Manager */ out_be32 (&im->mddrc.prioman_config1,CONFIG_SYS_MDDRCGRP_PM_CFG1 );
@@ -148,6 +160,9 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config,out_be32 (&im->mddrc.ddr_time_config0, mddrc_config->ddr_time_config0);out_be32 (&im->mddrc.ddr_sys_config, mddrc_config->ddr_sys_config); +/* Allow for the DLL to startup before accessing data */ +udelay (10 ); + msize =get_ram_size (CONFIG_SYS_DDR_BASE ,CONFIG_SYS_MAX_RAM_SIZE );/* Fix DDR Local Window for new size */ out_be32 (&im->sysconf.ddrlaw.ar,__ilog2 (msize) -1 );
arch/powerpc/include/asm/immap_512x.h +1 -0
@@ -351,6 +351,7 @@ typedef struct ddr512x {/* MDDRC SYS CFG and Timing CFG0 Registers */ #define MDDRC_SYS_CFG_EN 0xF0000000 +#define MDDRC_SYS_CFG_CKE_MASK 0x40000000#define MDDRC_SYS_CFG_CMD_MASK 0x10000000#define MDDRC_REFRESH_ZERO_MASK 0x0000FFFF
Signature · 1 line
1.7.5.4
PATCH 7/8 mpc512x: Adjust the DRAM init sequence to the datasheet spec
Dear Anatolij Gustschin,
Quoted 9 lines · In message <[email protected]> you wrote:
Do maintain a 200 usecs period of stable power and clock before asserting the CKE signal and sending commands, have at least 200 DRAM clock cycles pass after initialization before data access.
Signed-off-by Anatolij Gustschin <[email protected]>--- arch/powerpc/cpu/mpc512x/fixed_sdram.c | 17 ++++++++++++++++- arch/powerpc/include/asm/immap_512x.h | 1 + 2 files changed, 17 insertions(+), 1 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 3 lines
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 at denx.de
PATCH 8/8 mpc512x: pdm360ng: drop not needed memory node fixup
In reply to Anatolij Gustschinft_cpu_setup() already does memory node fixup, no need to do it again.
--- board/pdm360ng/pdm360ng.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
board/pdm360ng/pdm360ng.c +0 -1
@@ -500,7 +500,6 @@ void ft_board_setup(void *blob, bd_t *bd)int rc, i =0 ;ft_cpu_setup (blob, bd); -fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize);#ifdef CONFIG_FDT_FIXUP_PARTITIONS fdt_fixup_mtdparts (blob, nodes,ARRAY_SIZE (nodes));#endif
Signature · 1 line
1.7.5.4
PATCH 8/8 mpc512x: pdm360ng: drop not needed memory node fixup
Dear Anatolij Gustschin,
Quoted 7 lines · In message <[email protected]> you wrote:
ft_cpu_setup()already does memory node fixup, no need to do it again.Signed-off-by Anatolij Gustschin <[email protected]>--- board/pdm360ng/pdm360ng.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
Applied to u-boot-mpc5xxx repo, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 at denx.de "If you'll excuse me a minute, I'm going to have a cup of coffee." - broadcast from Apollo 11's LEM, "Eagle", to Johnson Space Center, Houston July 20, 1969, 7:27 P.M.