Support for the kmp204x reference design
Subsystems (4)
v4 cover Support for the kmp204x reference design
This series includes all the needed patches to run u-boot on Keymile's kmp204x reference design.
The kmp204x is a reference design based on Freescale's P2040/P2041 SoC. It is supposed to be a reference platform for future boards. There is currently only one board that is based on this design which is called kmlion1.
The first 10 patches of the series are small changes to the generic Keymile board support code as well as minor changes to some Freescale drivers and CPU support.
The final patch 11 is where the new kmp204x code is introduced. It is mostly based on the existing P2041rdb code by Freescale which was adapted to our design.
Changes in v4:
- rebased on mainline u-boot 2013.10
- fixed the name of the board to kmlion1
- changed the ENV #defines
- raised the ENV_SPI_MAX_HZ to 20 MHz
Changes in v3:
- Add SYS_MALLOC_LEN to km_arm.h as well, as it was omitted before.
- take the new I2C defines into account and use CONFIG_SYS_I2C_INIT_BOARD instead of an additional option and define it only for the I2C bitbang KM boards (km_arm and km82xx) and not for all KM boards.
- add a call to fman_enable_port in fm_enable_port enable the port in hardware as well.
- rebased on mainline u-boot 2013.10-rc2 (+ a few patches)
- use new licensing string
- move BCH #defines before keymile-common.h #include
- remove common RCW printing patch
- remove RCW printing form checkboard() as it is now in mpc85xx/cpu.c
- new I2C #defines for new I2C subsystem
- remove patch km-powerpc: move CONFIG_FLASH_CFI_MTD from km-powerpc.h since km-powerpc is not included by kmp204x.h
- fix RCW for new IRQ/GPIO usage of kmp204x
- set netdev to eth0 since the new DTS now correctly assigns FM1 at DTSEC to eth0
Changes in v2:
- Introduce CONFIG_KM_I2C_ABORT #define to avoid #if !defined in common.c
- add CONFIG_KM_COMMON_ETH_INIT for the km board that need the common.c board_eth_init
- when refresh rate gets halved for extended range temperature operations, the srt bit in the mode register 2 is set.
- Remove patch "5/8 fsl: do not define FSL_SRIO_PCIE_BOOT_MASTER for all P2041 systems" from the series as it is not needed with current u-boot.
- fix the defines used in kmp204x/law.c for the lbus local address windows.
- fix the header files to include Freescale's copyrights
- integrate Scott's feedback
Valentin Longchamp (11):
powerpc: cast bi_memsize to ulong for %ld usage
km-powerpc: move SYS_MALLOC_LEN out of keymile-common.h
KM: fix typo in default environment
KM: define CONFIG_SYS_I2C_INIT_BOARD only for concerned board
KM: add CONFIG_KM_COMMON_ETH_INIT for km common eth init
mpc8xxx: call i2c_set_bus_num in __get_spd
mpc8xxx: set x2 DDR3 refresh rate if SPD config requires it net/fman: add a fm_enable_port function
mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into account fsl/mpc85xx: define common serdes_clock_to_string function
mpc85xx: introduce the kmp204x reference design support
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 21 + arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 17 + .../powerpc/cpu/mpc8xxx/ddr/common_timing_params.h | 1 + arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 7 +- arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c | 4 + .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c | 5 + arch/powerpc/cpu/mpc8xxx/ddr/main.c | 6 +- arch/powerpc/include/asm/fsl_ddr_dimm_params.h | 1 + arch/powerpc/include/asm/fsl_serdes.h | 1 + arch/powerpc/lib/board.c | 2 +- board/freescale/b4860qds/b4860qds.c | 16 - board/freescale/corenet_ds/corenet_ds.c | 14 - board/freescale/p2041rdb/p2041rdb.c | 14 - board/freescale/t4qds/t4240qds.c | 16 - board/keymile/common/common.c | 27 +- board/keymile/kmp204x/Makefile | 48 +++ board/keymile/kmp204x/ddr.c | 64 +++ board/keymile/kmp204x/eth.c | 71 ++++ board/keymile/kmp204x/kmp204x.c | 258 ++++++++++++ board/keymile/kmp204x/kmp204x.h | 15 + board/keymile/kmp204x/law.c | 40 ++ board/keymile/kmp204x/pbi.cfg | 35 ++ board/keymile/kmp204x/pci.c | 35 ++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 110 +++++ boards.cfg | 3 + drivers/mtd/nand/fsl_elbc_nand.c | 6 +- drivers/net/fm/b4860.c | 7 + drivers/net/fm/fm.h | 1 + drivers/net/fm/init.c | 8 + drivers/net/fm/p1023.c | 7 + drivers/net/fm/p4080.c | 7 + drivers/net/fm/p5020.c | 7 + drivers/net/fm/p5040.c | 7 + drivers/net/fm/t4240.c | 7 + include/configs/km/keymile-common.h | 6 +- include/configs/km/km-powerpc.h | 6 + include/configs/km/km_arm.h | 8 +- include/configs/km/kmp204x-common.h | 450 +++++++++++++++++++++ include/configs/km82xx.h | 2 + include/configs/kmp204x.h | 68 ++++ include/fm_eth.h | 1 + 42 files changed, 1343 insertions(+), 97 deletions(-) create mode 100644 board/keymile/kmp204x/Makefile create mode 100644 board/keymile/kmp204x/ddr.c create mode 100644 board/keymile/kmp204x/eth.c create mode 100644 board/keymile/kmp204x/kmp204x.c create mode 100644 board/keymile/kmp204x/kmp204x.h create mode 100644 board/keymile/kmp204x/law.c create mode 100644 board/keymile/kmp204x/pbi.cfg create mode 100644 board/keymile/kmp204x/pci.c create mode 100644 board/keymile/kmp204x/rcw_kmp204x.cfg create mode 100644 board/keymile/kmp204x/tlb.c create mode 100644 include/configs/km/kmp204x-common.h create mode 100644 include/configs/kmp204x.h
Signature · 1 line
1.8.0.1
PATCH v4 1/11 powerpc: cast bi_memsize to ulong for %ld usage
When exporting the new memsize without reserved PRAM area, the -Wformat option produces a warning since %ld is used for snprintf and bi_memsize is phys_size_t.
This patch removes this warning for all PRAM PowerPC boards.
---
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/powerpc/lib/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/lib/board.c +1 -1
@@ -984,7 +984,7 @@ void board_init_r(gd_t *id, ulong dest_addr) pram += (LOGBUFF_LEN +LOGBUFF_OVERHEAD ) /1024 ;#endif #endif -sprintf (memsz,"%ldk" , (bd->bi_memsize /1024 ) - pram); +sprintf (memsz,"%ldk" , (ulong) (bd->bi_memsize /1024 ) - pram); setenv("mem", memsz); }#endif
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 1/11 powerpc: cast bi_memsize to ulong for %ld usage
Quoted 4 lines · Valentin Longchamp
When exporting the new memsize without reserved PRAM area, the -Wformat option produces a warning since %ld is used for snprintf and
bi_memsizeisphys_size_t.
Quoted 8 lines
This patch removes this warning for all PRAM PowerPC boards.
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 2/11 km-powerpc: move SYS_MALLOC_LEN out of keymile-common.h
In reply to Valentin LongchampIt must be set to a different value for the later add kmp204x architecture, because we are restricted to 1MB SRAM.
---
Changes in v4: None
Changes in v3:
- Add SYS_MALLOC_LEN to km_arm.h as well, as it was omitted before.
Changes in v2: None
include/configs/km/keymile-common.h | 2 -- include/configs/km/km-powerpc.h | 3 +++ include/configs/km/km_arm.h | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-)
include/configs/km/keymile-common.h +0 -2
@@ -80,8 +80,6 @@#define CONFIG_BOOTP_GATEWAY #define CONFIG_BOOTP_HOSTNAME -#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) -/* UBI Support for all Keymile boards */ #define CONFIG_CMD_UBI #define CONFIG_RBTREE
include/configs/km/km-powerpc.h +3 -0
@@ -32,6 +32,9 @@#define CONFIG_SYS_LOAD_ADDR 0x100000/* default load address */ +/* Reserve 4 MB for malloc */ +#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) +/****************************************************************************** * (PRAM usage) * ... -------------------------------------------------------
include/configs/km/km_arm.h +3 -0
@@ -54,6 +54,9 @@#define CONFIG_ENV_SPI_MODE SPI_MODE_3#endif +/* Reserve 4 MB for malloc */ +#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) +#include "asm/arch/config.h" #define CONFIG_SYS_TEXT_BASE 0x07d00000/* code address before reloc */
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 2/11 km-powerpc: move SYS_MALLOC_LEN out of keymile-common.h
Quoted 12 lines · Valentin Longchamp
It must be set to a different value for the later add kmp204x architecture, because we are restricted to 1MB SRAM.
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3:
- AddSYS_MALLOC_LENtokm_arm.has well, as it was omitted before.Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 3/11 KM: fix typo in default environment
In reply to Valentin LongchampThe ip kernel parameter had a typo in it (we've been lucky that it has worked until now).
---
Changes in v4: None
Changes in v3: None
Changes in v2: None
include/configs/km/keymile-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/km/keymile-common.h +1 -1
@@ -165,7 +165,7 @@"add_default=" \"setenv bootargs ${bootargs} " \"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ -":${hostname}:${netdev}:off3" \ +":${hostname}:${netdev}:off:" \" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \" mem=${kernelmem} init=${init}" \CONFIG_KM_ECC_MODE \
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 3/11 KM: fix typo in default environment
Quoted 9 lines · Valentin Longchamp
The ip kernel parameter had a typo in it (we've been lucky that it has worked until now).
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 4/11 KM: define CONFIG_SYS_I2C_INIT_BOARD only for concerned board
In reply to Valentin LongchampThis must be defined for all the keymile boards that use the common i2c_abort function that is used to "reset" the I2C bus. These are currently km82xx and km_arm boards.
The km83xx boards use other functions and thus do not need this.
This patch removes the CONFIG_SYS_I2C_INIT_BOARD from keymile-common.h and defines it for km_arm.h and km82xx.h.
---
Changes in v4: None
Changes in v3:
- take the new I2C defines into account and use CONFIG_SYS_I2C_INIT_BOARD instead of an additional option and define it only for the I2C bitbang KM boards (km_arm and km82xx) and not for all KM boards.
Changes in v2:
- Introduce CONFIG_KM_I2C_ABORT #define to avoid #if !defined in common.c
board/keymile/common/common.c | 25 ------------------------- include/configs/km/keymile-common.h | 2 -- include/configs/km/km_arm.h | 4 +--- include/configs/km82xx.h | 2 ++ 4 files changed, 3 insertions(+), 30 deletions(-)
board/keymile/common/common.c +0 -25
@@ -24,10 +24,6 @@#include "common.h" #include <i2c.h> -#if !defined(CONFIG_MPC83xx) -static void i2c_write_start_seq (void ); -#endif -DECLARE_GLOBAL_DATA_PTR ;/*
@@ -78,7 +74,6 @@ int set_km_env(void) }#if defined(CONFIG_SYS_I2C_INIT_BOARD ) -#if !defined(CONFIG_MPC83xx)static void i2c_write_start_seq (void ) {set_sda (1 );
@@ -101,21 +96,6 @@ static void i2c_write_start_seq(void)*/ int i2c_make_abort (void ) { - -#if defined(CONFIG_HARD_I2C ) && !defined(MACH_TYPE_KM_KIRKWOOD ) -immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ; -i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c; - -/* -* disable I2C controller first, otherwhise it thinks we want to -* talk to the slave port... -*/ -clrbits_8 (&i2c->i2c_i2mod,0x01 ); - -/* Set the PortPins to GPIO */ -setports (1 ); -#endif -int scl_state =0 ;int sda_state =0 ;int i =0 ;
@@ -148,13 +128,8 @@ int i2c_make_abort(void)set_sda (1 );get_sda (); -#if defined(CONFIG_HARD_I2C ) -/* Set the PortPins back to use for I2C */ -setports (0 ); -#endif return ret; } -#endif /** * i2c_init_board - reset i2c bus. When the board is powercycled during a
include/configs/km/keymile-common.h +0 -2
@@ -63,8 +63,6 @@#define CONFIG_LOADS_ECHO #define CONFIG_SYS_LOADS_BAUD_CHANGE -#define CONFIG_SYS_I2C_INIT_BOARD -/* Support the IVM EEprom */ #define CONFIG_SYS_IVM_EEPROM_ADR 0x50#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
include/configs/km/km_arm.h +1 -3
@@ -176,10 +176,9 @@#undef CONFIG_I2C_MVTWSI#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ +#define CONFIG_SYS_I2C_INIT_BOARD #define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ -#if defined(CONFIG_SYS_I2C_SOFT ) -#define CONFIG_SYS_NUM_I2C_BUSES 6#define CONFIG_SYS_I2C_MAX_HOPS 1#define CONFIG_SYS_I2C_BUSES { {0, {I2C_NULL_HOP} }, \
@@ -214,7 +213,6 @@ int get_scl(void);#define CONFIG_SYS_I2C_SOFT_SLAVE 0x0#define CONFIG_SYS_I2C_SOFT_SPEED 100000 -#endif /* EEprom support 24C128, 24C256 valid for environment eeprom */ #define CONFIG_SYS_I2C_MULTI_EEPROMS
include/configs/km82xx.h +2 -0
@@ -227,6 +227,7 @@/* enable I2C and select the hardware/software driver */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ +#define CONFIG_SYS_I2C_INIT_BOARD #define CONFIG_SYS_NUM_I2C_BUSES 3#define CONFIG_SYS_I2C_MAX_HOPS 1#define CONFIG_SYS_I2C_SOFT_SPEED 50000
@@ -237,6 +238,7 @@ {0, {{I2C_MUX_PCA9542, 0x70, 1} } } }#define CONFIG_KM_IVM_BUS 1/* I2C2 (Mux-Port 1)*/ +#define CONFIG_KM_I2C_ABORT /* * Software (bit-bang) I2C driver configuration
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 4/11 KM: define CONFIG_SYS_I2C_INIT_BOARD only for concerned board
Quoted 19 lines · Valentin Longchamp
This must be defined for all the keymile boards that use the common
i2c_abortfunction that is used to "reset" the I2C bus. These are currently km82xx andkm_armboards.The km83xx boards use other functions and thus do not need this.
This patch removes the
CONFIG_SYS_I2C_INIT_BOARDfromkeymile-common.hand defines it forkm_arm.handkm82xx.h.Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3:
- take the new I2C defines into account and useCONFIG_SYS_I2C_INIT_BOARDinstead of an additional option and define it only for the I2C bitbang KM boards (km_armand km82xx) and not for all KM boards.
Quoted 3 lines
Changes in v2:
- IntroduceCONFIG_KM_I2C_ABORT#define to avoid #if !defined incommon.c
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 4/11 KM: define CONFIG_SYS_I2C_INIT_BOARD only for concerned board
In reply to Valentin LongchampHello Valentin,
Am 18.10.2013 11:47, schrieb Valentin Longchamp:
Quoted 23 lines
This must be defined for all the keymile boards that use the common
i2c_abortfunction that is used to "reset" the I2C bus. These are currently km82xx andkm_armboards.The km83xx boards use other functions and thus do not need this.
This patch removes the
CONFIG_SYS_I2C_INIT_BOARDfromkeymile-common.hand defines it forkm_arm.handkm82xx.h.Signed-off-by Valentin Longchamp<[email protected]>---
Changes in v4: None
Changes in v3:
- take the new I2C defines into account and useCONFIG_SYS_I2C_INIT_BOARDinstead of an additional option and define it only for the I2C bitbang KM boards (km_armand km82xx) and not for all KM boards.Changes in v2:
- IntroduceCONFIG_KM_I2C_ABORT#define to avoid #if !defined incommon.c
Quoted 5 lines
board/keymile/common/common.c | 25 ------------------------- include/configs/km/keymile-common.h | 2 -- include/configs/km/km_arm.h | 4 +--- include/configs/km82xx.h | 2 ++ 4 files changed, 3 insertions(+), 30 deletions(-)
Thanks.
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH v4 5/11 KM: add CONFIG_KM_COMMON_ETH_INIT for km common eth init
In reply to Valentin LongchampThis must be defined by a board support file that want to use the keymile common.c board_eth_init function that requires ethernet_present to be defined.
Currently all the km architectures use it but the kmp204x architecture later supported in this series does use another board_eth_init function and thus does not define it.
---
Changes in v4: None
Changes in v3: None
Changes in v2:
- add CONFIG_KM_COMMON_ETH_INIT for the km board that need the common.c board_eth_init
board/keymile/common/common.c | 2 ++ include/configs/km/km-powerpc.h | 3 +++ include/configs/km/km_arm.h | 1 + 3 files changed, 6 insertions(+)
board/keymile/common/common.c +2 -0
@@ -142,6 +142,7 @@ void i2c_init_board(void) }#endif +#if defined(CONFIG_KM_COMMON_ETH_INIT )int board_eth_init (bd_t *bis) {if (ethernet_present ())
@@ -149,6 +150,7 @@ int board_eth_init(bd_t *bis) return -1; } +#endif /* * do_setboardid command
include/configs/km/km-powerpc.h +3 -0
@@ -17,6 +17,9 @@#define CONFIG_CMD_DTT #define CONFIG_JFFS2_CMDLINE +/* standard km ethernet_present for piggy */ +#define CONFIG_KM_COMMON_ETH_INIT +/* EEprom support 24C08, 24C16, 24C64 */ #define CONFIG_SYS_I2C_MULTI_EEPROMS #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
include/configs/km/km_arm.h +1 -0
@@ -164,6 +164,7 @@#define CONFIG_MVGBE_PORTS {1, 0}/* enable port 0 only */ #define CONFIG_PHY_BASE_ADR 0#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */ +#define CONFIG_KM_COMMON_ETH_INIT /* standard km ethernet_present for piggy */ /* * UBI related stuff
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 5/11 KM: add CONFIG_KM_COMMON_ETH_INIT for km common eth init
Quoted 8 lines · Valentin Longchamp
This must be defined by a board support file that want to use the keymile
common.cboard_eth_initfunction that requiresethernet_presentto be defined.Currently all the km architectures use it but the kmp204x architecture later supported in this series does use another
board_eth_initfunction and thus does not define it.
Quoted 8 lines
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2:
- addCONFIG_KM_COMMON_ETH_INITfor the km board that need thecommon.cboard_eth_init
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 6/11 mpc8xxx: call i2c_set_bus_num in __get_spd
In reply to Valentin LongchampThis is necessary with the new I2C subystem that was introduced lately.
---
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/powerpc/cpu/mpc8xxx/ddr/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/cpu/mpc8xxx/ddr/main.c +5 -1
@@ -69,7 +69,11 @@ u8 spd_i2c_addr[CONFIG_NUM_DDR_CONTROLLERS][CONFIG_DIMM_SLOTS_PER_CTLR] = {static void __get_spd (generic_spd_eeprom_t *spd,u8 i2c_address) { -int ret =i2c_read (i2c_address,0 ,1 , (uchar *)spd, +int ret; + +i2c_set_bus_num (CONFIG_SYS_SPD_BUS_NUM ); + + ret =i2c_read (i2c_address,0 ,1 , (uchar *)spd,sizeof (generic_spd_eeprom_t));if (ret) {
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 6/11 mpc8xxx: call i2c_set_bus_num in __get_spd
Quoted 8 lines · Valentin Longchamp
This is necessary with the new I2C subystem that was introduced lately.
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 6/11 mpc8xxx: call i2c_set_bus_num in __get_spd
In reply to Valentin LongchampHello Valentin,
Am 18.10.2013 11:47, schrieb Valentin Longchamp:
Quoted 10 lines
This is necessary with the new I2C subystem that was introduced lately.
Signed-off-by Valentin Longchamp<[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2: Nonearch/powerpc/cpu/mpc8xxx/ddr/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Thanks.
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH v4 7/11 mpc8xxx: set x2 DDR3 refresh rate if SPD config requires it
In reply to Valentin LongchampIf the DDR3 module supports industrial temperature range and requires the x2 refresh rate for that temp range, the refresh period must be 3.9us instead of 7.8 us.
This was successfuly tested on kmp204x board with some MT41K128M16 DDR3 RAM chips (no module used, chips directly soldered on board with an SPD EEPROM).
---
Changes in v4: None
Changes in v3: None
Changes in v2:
- when refresh rate gets halved for extended range temperature operations, the srt bit in the mode register 2 is set.
arch/powerpc/cpu/mpc8xxx/ddr/common_timing_params.h | 1 + arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 7 ++++++- arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c | 4 ++++ arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c | 5 +++++ arch/powerpc/include/asm/fsl_ddr_dimm_params.h | 1 + 5 files changed, 17 insertions(+), 1 deletion(-)
arch/powerpc/cpu/mpc8xxx/ddr/common_timing_params.h +1 -0
@@ -28,6 +28,7 @@ typedef struct {unsigned int tRC_ps;/* maximum = 254 ns + .75 ns = 254750 ps */ unsigned int refresh_rate_ps; +unsigned int extended_op_srt;unsigned int tIS_ps;/* byte 32, spd->ca_setup */ unsigned int tIH_ps;/* byte 33, spd->ca_hold */
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +6 -1
@@ -765,6 +765,7 @@ static void set_ddr_sdram_cfg_2(fsl_ddr_cfg_regs_t *ddr,/* DDR SDRAM Mode configuration 2 (DDR_SDRAM_MODE_2) */ static void set_ddr_sdram_mode_2 (fsl_ddr_cfg_regs_t *ddr,const memctl_options_t *popts, +const common_timing_params_t *common_dimm,const unsigned int unq_mrs_en) {unsigned short esdmode2 =0 ;/* Extended SDRAM mode 2 */
@@ -782,6 +783,10 @@ static void set_ddr_sdram_mode_2(fsl_ddr_cfg_regs_t *ddr, rtt_wr = popts->rtt_wr_override_value; else rtt_wr = popts->cs_local_opts[0 ].odt_rtt_wr; + +if (common_dimm->extended_op_srt) + srt = common_dimm->extended_op_srt; + esdmode2 = (0 | ((rtt_wr &0x3 ) <<9 ) | ((srt & 0x1) << 7)
@@ -1626,7 +1631,7 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,set_ddr_sdram_cfg_2 (ddr, popts, unq_mrs_en);set_ddr_sdram_mode (ddr, popts, common_dimm, cas_latency, additive_latency, unq_mrs_en); -set_ddr_sdram_mode_2 (ddr, popts, unq_mrs_en); +set_ddr_sdram_mode_2 (ddr, popts, common_dimm, unq_mrs_en);set_ddr_sdram_interval (ddr, popts, common_dimm);set_ddr_data_init (ddr);set_ddr_sdram_clk_cntl (ddr, popts);
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +4 -0
@@ -321,6 +321,10 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,* = 3.9 us@ext temperature range */ pdimm->refresh_rate_ps =7800000 ; +if ((spd->therm_ref_opt &0x1 ) && !(spd->therm_ref_opt &0x2 )) { + pdimm->refresh_rate_ps =3900000 ; + pdimm->extended_op_srt =1 ; + }/* * min four active window delay time
arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c +5 -0
@@ -92,6 +92,7 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params,unsigned int tRRD_ps =0 ;unsigned int tRC_ps =0 ;unsigned int refresh_rate_ps =0 ; +unsigned int extended_op_srt =1 ;unsigned int tIS_ps =0 ;unsigned int tIH_ps =0 ;unsigned int tDS_ps =0 ;
@@ -166,6 +167,9 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params, tQHS_ps =max (tQHS_ps, dimm_params[i].tQHS_ps); refresh_rate_ps =max (refresh_rate_ps, dimm_params[i].refresh_rate_ps); +/* extended_op_srt is either 0 or 1, 0 having priority */ + extended_op_srt =min (extended_op_srt, + dimm_params[i].extended_op_srt);/* * Find maximum tDQSQ_max_ps to find slowest.
@@ -195,6 +199,7 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params, outpdimm->tRRD_ps = tRRD_ps; outpdimm->tRC_ps = tRC_ps; outpdimm->refresh_rate_ps = refresh_rate_ps; + outpdimm->extended_op_srt = extended_op_srt; outpdimm->tIS_ps = tIS_ps; outpdimm->tIH_ps = tIH_ps; outpdimm->tDS_ps = tDS_ps;
arch/powerpc/include/asm/fsl_ddr_dimm_params.h +1 -0
@@ -78,6 +78,7 @@ typedef struct dimm_params_s {unsigned int tRC_ps;/* maximum = 254 ns + .75 ns = 254750 ps */ unsigned int refresh_rate_ps; +unsigned int extended_op_srt;/* DDR3 doesn't need these as below */ unsigned int tIS_ps;/* byte 32, spd->ca_setup */
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 7/11 mpc8xxx: set x2 DDR3 refresh rate if SPD config requires it
Quoted 8 lines · Valentin Longchamp
If the DDR3 module supports industrial temperature range and requires the x2 refresh rate for that temp range, the refresh period must be 3.9us instead of 7.8 us.
This was successfuly tested on kmp204x board with some MT41K128M16 DDR3 RAM chips (no module used, chips directly soldered on board with an SPD EEPROM).
Quoted 9 lines
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2:
- when refresh rate gets halved for extended range temperature operations, the srt bit in the mode register 2 is set.
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 8/11 net/fman: add a fm_enable_port function
In reply to Valentin LongchampThis can be useful if one wants to disable an interface in u-boot because u-boot should not manage it but then later reenable it for FDT fixing or if the kernel uses this interface.
---
Changes in v4: None
Changes in v3:
- add a call to fman_enable_port in fm_enable_port enable the port in hardware as well.
Changes in v2: None
drivers/net/fm/b4860.c | 7 +++++++ drivers/net/fm/fm.h | 1 + drivers/net/fm/init.c | 8 ++++++++ drivers/net/fm/p1023.c | 7 +++++++ drivers/net/fm/p4080.c | 7 +++++++ drivers/net/fm/p5020.c | 7 +++++++ drivers/net/fm/p5040.c | 7 +++++++ drivers/net/fm/t4240.c | 7 +++++++ include/fm_eth.h | 1 + 9 files changed, 52 insertions(+)
drivers/net/fm/b4860.c +7 -0
@@ -37,6 +37,13 @@ void fman_disable_port(enum fm_port port)setbits_be32 (&gur->devdisr2, port_to_devdisr[port]); } +void fman_enable_port (enum fm_port port) +{ +ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + +clrbits_be32 (&gur->devdisr2, port_to_devdisr[port]); +} +phy_interface_t fman_port_enet_if (enum fm_port port) {if (is_device_disabled (port))
drivers/net/fm/fm.h +1 -0
@@ -98,6 +98,7 @@ int fm_init_common(int index, struct ccsr_fman *reg);int fm_eth_initialize (struct ccsr_fman *reg,struct fm_eth_info *info);phy_interface_t fman_port_enet_if (enum fm_port port);void fman_disable_port (enum fm_port port); +void fman_enable_port (enum fm_port port);struct fsl_enet_mac {void *base;/* MAC controller registers base address */
drivers/net/fm/init.c +8 -0
@@ -145,6 +145,14 @@ void fm_disable_port(enum fm_port port)fman_disable_port (port); } +void fm_enable_port (enum fm_port port) +{ +int i =fm_port_to_index (port); + + fm_info[i].enabled =1 ; +fman_enable_port (port); +} +void fm_info_set_mdio (enum fm_port port,struct mii_dev *bus) {int i =fm_port_to_index (port);
drivers/net/fm/p1023.c +7 -0
@@ -34,6 +34,13 @@ void fman_disable_port(enum fm_port port)setbits_be32 (&gur->devdisr, port_to_devdisr[port]); } +void fman_enable_port (enum fm_port port) +{ +ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + +clrbits_be32 (&gur->devdisr, port_to_devdisr[port]); +} +phy_interface_t fman_port_enet_if (enum fm_port port) {ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
drivers/net/fm/p4080.c +7 -0
@@ -42,6 +42,13 @@ void fman_disable_port(enum fm_port port)setbits_be32 (&gur->devdisr2, port_to_devdisr[port]); } +void fman_enable_port (enum fm_port port) +{ +ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + +clrbits_be32 (&gur->devdisr2, port_to_devdisr[port]); +} +phy_interface_t fman_port_enet_if (enum fm_port port) {ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
drivers/net/fm/p5020.c +7 -0
@@ -38,6 +38,13 @@ void fman_disable_port(enum fm_port port)setbits_be32 (&gur->devdisr2, port_to_devdisr[port]); } +void fman_enable_port (enum fm_port port) +{ +ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + +clrbits_be32 (&gur->devdisr2, port_to_devdisr[port]); +} +phy_interface_t fman_port_enet_if (enum fm_port port) {ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
drivers/net/fm/p5040.c +7 -0
@@ -44,6 +44,13 @@ void fman_disable_port(enum fm_port port)setbits_be32 (&gur->devdisr2, port_to_devdisr[port]); } +void fman_enable_port (enum fm_port port) +{ +ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + +clrbits_be32 (&gur->devdisr2, port_to_devdisr[port]); +} +phy_interface_t fman_port_enet_if (enum fm_port port) {ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
drivers/net/fm/t4240.c +7 -0
@@ -49,6 +49,13 @@ void fman_disable_port(enum fm_port port)setbits_be32 (&gur->devdisr2, port_to_devdisr[port]); } +void fman_enable_port (enum fm_port port) +{ +ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + +clrbits_be32 (&gur->devdisr2, port_to_devdisr[port]); +} +phy_interface_t fman_port_enet_if (enum fm_port port) {ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
include/fm_eth.h +1 -0
@@ -149,5 +149,6 @@ void fm_info_set_phy_address(enum fm_port port, int address);int fm_info_get_phy_address (enum fm_port port);void fm_info_set_mdio (enum fm_port port,struct mii_dev *bus);void fm_disable_port (enum fm_port port); +void fm_enable_port (enum fm_port port);#endif
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 8/11 net/fman: add a fm_enable_port function
Quoted 6 lines · Valentin Longchamp
This can be useful if one wants to disable an interface in u-boot because u-boot should not manage it but then later reenable it for FDT fixing or if the kernel uses this interface.
Signed-off-by Valentin Longchamp <[email protected]>
Quoted 8 lines
---
Changes in v4: None
Changes in v3:
- add a call tofman_enable_portinfm_enable_portenable the port in hardware as well.Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 9/11 mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into account
In reply to Valentin LongchampNAND_ECC_SOFT was the only option available while the SOFT_BCH option may also be used.
---
Changes in v4: None
Changes in v3: None
Changes in v2: None
drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mtd/nand/fsl_elbc_nand.c +5 -1
@@ -759,8 +759,12 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr) nand->ecc.steps =1 ; nand->ecc.strength =1 ; }else { -/* otherwise fall back to default software ECC */ +/* otherwise fall back to software ECC */ +#if defined(CONFIG_NAND_ECC_BCH ) + nand->ecc.mode =NAND_ECC_SOFT_BCH ; +#else nand->ecc.mode =NAND_ECC_SOFT ; +#endif } ret =nand_scan_ident (mtd,1 ,NULL );
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 9/11 mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into account
Quoted 10 lines · Valentin Longchamp
NAND_ECC_SOFTwas the only option available while theSOFT_BCHoption may also be used.Signed-off-by Valentin Longchamp <[email protected]>Acked-by Scott Wood <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 10/11 fsl/mpc85xx: define common serdes_clock_to_string function
In reply to Valentin LongchampThis allows to share some common code for the boards that use a corenet base SoC.
Two different versions of the function are available in fsl_corenet_serdes.c and fsl_corenet2_serdes.c files.
---
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 21 +++++++++++++++++++++ arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 17 +++++++++++++++++ arch/powerpc/include/asm/fsl_serdes.h | 1 + board/freescale/b4860qds/b4860qds.c | 16 ---------------- board/freescale/corenet_ds/corenet_ds.c | 14 -------------- board/freescale/p2041rdb/p2041rdb.c | 14 -------------- board/freescale/t4qds/t4240qds.c | 16 ---------------- 7 files changed, 39 insertions(+), 60 deletions(-)
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +21 -0
@@ -201,3 +201,24 @@ void fsl_serdes_init(void)#endif } + +const char *serdes_clock_to_string (u32 clock) +{ +switch (clock) { +case SRDS_PLLCR0_RFCK_SEL_100 : +return "100" ; +case SRDS_PLLCR0_RFCK_SEL_125 : +return "125" ; +case SRDS_PLLCR0_RFCK_SEL_156_25 : +return "156.25" ; +case SRDS_PLLCR0_RFCK_SEL_161_13 : +return "161.1328123" ; +default : +#if defined(CONFIG_T4240QDS ) +return "???" ; +#else +return "122.88" ; +#endif + } +} +
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +17 -0
@@ -858,3 +858,20 @@ void fsl_serdes_init(void) }#endif } + +const char *serdes_clock_to_string (u32 clock) +{ +switch (clock) { +case SRDS_PLLCR0_RFCK_SEL_100 : +return "100" ; +case SRDS_PLLCR0_RFCK_SEL_125 : +return "125" ; +case SRDS_PLLCR0_RFCK_SEL_156_25 : +return "156.25" ; +case SRDS_PLLCR0_RFCK_SEL_161_13 : +return "161.1328123" ; +default : +return "150" ; + } +} +
arch/powerpc/include/asm/fsl_serdes.h +1 -0
@@ -86,6 +86,7 @@ enum srds {int is_serdes_configured (enum srds_prtcl device);void fsl_serdes_init (void ); +const char *serdes_clock_to_string (u32 clock);#ifdef CONFIG_FSL_CORENET #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
board/freescale/b4860qds/b4860qds.c +0 -16
@@ -457,22 +457,6 @@ static int serdes_refclock(u8 sw, u8 sdclk)return ret; } -static const char *serdes_clock_to_string (u32 clock) -{ -switch (clock) { -case SRDS_PLLCR0_RFCK_SEL_100 : -return "100" ; -case SRDS_PLLCR0_RFCK_SEL_125 : -return "125" ; -case SRDS_PLLCR0_RFCK_SEL_156_25 : -return "156.25" ; -case SRDS_PLLCR0_RFCK_SEL_161_13 : -return "161.13" ; -default : -return "122.88" ; - } -} -#define NUM_SRDS_BANKS 2int misc_init_r (void )
board/freescale/corenet_ds/corenet_ds.c +0 -14
@@ -127,20 +127,6 @@ int board_early_init_r(void)return 0 ; } -static const char *serdes_clock_to_string (u32 clock) -{ -switch (clock) { -case SRDS_PLLCR0_RFCK_SEL_100 : -return "100" ; -case SRDS_PLLCR0_RFCK_SEL_125 : -return "125" ; -case SRDS_PLLCR0_RFCK_SEL_156_25 : -return "156.25" ; -default : -return "150" ; - } -} -#define NUM_SRDS_BANKS 3int misc_init_r (void )
board/freescale/p2041rdb/p2041rdb.c +0 -14
@@ -155,20 +155,6 @@ unsigned long get_board_sys_clk(unsigned long dummy) } } -static const char *serdes_clock_to_string (u32 clock) -{ -switch (clock) { -case SRDS_PLLCR0_RFCK_SEL_100 : -return "100" ; -case SRDS_PLLCR0_RFCK_SEL_125 : -return "125" ; -case SRDS_PLLCR0_RFCK_SEL_156_25 : -return "156.25" ; -default : -return "150" ; - } -} -#define NUM_SRDS_BANKS 2int misc_init_r (void )
board/freescale/t4qds/t4240qds.c +0 -16
@@ -608,22 +608,6 @@ unsigned long get_board_ddr_clk(void)return 66666666 ; } -static const char *serdes_clock_to_string (u32 clock) -{ -switch (clock) { -case SRDS_PLLCR0_RFCK_SEL_100 : -return "100" ; -case SRDS_PLLCR0_RFCK_SEL_125 : -return "125" ; -case SRDS_PLLCR0_RFCK_SEL_156_25 : -return "156.25" ; -case SRDS_PLLCR0_RFCK_SEL_161_13 : -return "161.1328125" ; -default : -return "???" ; - } -} -int misc_init_r (void ) {u8 sw;
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 10/11 fsl/mpc85xx: define common serdes_clock_to_string function
Quoted 11 lines · Valentin Longchamp
This allows to share some common code for the boards that use a corenet base SoC.
Two different versions of the function are available in
fsl_corenet_serdes.candfsl_corenet2_serdes.cfiles.Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4: None
Changes in v3: None
Changes in v2: None
Applied to 85xx/next, pending merge to 85xx/master.
York
PATCH v4 11/11 mpc85xx: introduce the kmp204x reference design support
In reply to Valentin LongchampThis patch introduces the support for Keymile's kmp204x reference design. This design is based on Freescale's P2040/P2041 SoC.
The peripherals used by this design are:
- DDR3 RAM with SPD support
- SPI NOR Flash as boot medium
- NAND Flash
- 2 PCIe busses (hosts 1 and 3)
- 3 FMAN Ethernet devices (FMAN1 DTSEC1/2/5)
- 3 Local Bus windows, with one dedicated to the QRIO reset/power mgmt FPGA
- 2 HW I2C busses
- last but not least, the mandatory serial port
The board/keymile/kmp204x code is mostly based on Freescale's P2041rdb support and was changed according to our design (that means essentially removing what is not present on the designs and a few adaptations).
There is currently only one prototype board that is based on this design and this patch also introduces it. The board is called kmlion1.
kmp204x: update the ENV #define
The comments had to be refined as well as the total size
---
Changes in v4:
- rebased on mainline u-boot 2013.10
- fixed the name of the board to kmlion1
- changed the ENV #defines
- raised the ENV_SPI_MAX_HZ to 20 MHz
Changes in v3:
- rebased on mainline u-boot 2013.10-rc2 (+ a few patches)
- use new licensing string
- move BCH #defines before keymile-common.h #include
- remove common RCW printing patch
- remove RCW printing form checkboard() as it is now in mpc85xx/cpu.c
- new I2C #defines for new I2C subsystem
- remove patch km-powerpc: move CONFIG_FLASH_CFI_MTD from km-powerpc.h since km-powerpc is not included by kmp204x.h
- fix RCW for new IRQ/GPIO usage of kmp204x
- set netdev to eth0 since the new DTS now correctly assigns FM1 at DTSEC to eth0
Changes in v2:
- Remove patch "5/8 fsl: do not define FSL_SRIO_PCIE_BOOT_MASTER for all P2041 systems" from the series as it is not needed with current u-boot.
- fix the defines used in kmp204x/law.c for the lbus local address windows.
- fix the header files to include Freescale's copyrights
- integrate Scott's feedback
board/keymile/kmp204x/Makefile | 48 ++++ board/keymile/kmp204x/ddr.c | 64 +++++ board/keymile/kmp204x/eth.c | 71 ++++++ board/keymile/kmp204x/kmp204x.c | 258 +++++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 15 ++ board/keymile/kmp204x/law.c | 40 +++ board/keymile/kmp204x/pbi.cfg | 35 +++ board/keymile/kmp204x/pci.c | 35 +++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 110 +++++++++ boards.cfg | 3 + include/configs/km/kmp204x-common.h | 450 ++++++++++++++++++++++++++++++++++ include/configs/kmp204x.h | 68 +++++ 13 files changed, 1208 insertions(+) create mode 100644 board/keymile/kmp204x/Makefile create mode 100644 board/keymile/kmp204x/ddr.c create mode 100644 board/keymile/kmp204x/eth.c create mode 100644 board/keymile/kmp204x/kmp204x.c create mode 100644 board/keymile/kmp204x/kmp204x.h create mode 100644 board/keymile/kmp204x/law.c create mode 100644 board/keymile/kmp204x/pbi.cfg create mode 100644 board/keymile/kmp204x/pci.c create mode 100644 board/keymile/kmp204x/rcw_kmp204x.cfg create mode 100644 board/keymile/kmp204x/tlb.c create mode 100644 include/configs/km/kmp204x-common.h create mode 100644 include/configs/kmp204x.h
board/keymile/kmp204x/Makefile new file +48 -0
@@ -0,0 +1,48 @@ +# +# (C) Copyright 2001-2007 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# 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. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk +ifneq ($(OBJTREE),$(SRCTREE)) +$(shell mkdir -p $(obj)../common) +endif + +LIB = $(obj)lib$(BOARD).o + +COBJS := $(BOARD).o ddr.o eth.o tlb.o pci.o law.o \ + ../common/common.o ../common/ivm.o + +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/keymile/kmp204x/ddr.c new file +64 -0
64 lines not on this page · raw message
board/keymile/kmp204x/eth.c new file +71 -0
71 lines not on this page · raw message
board/keymile/kmp204x/kmp204x.c new file +258 -0
258 lines not on this page · raw message
board/keymile/kmp204x/kmp204x.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* (C) Copyright 2013 Keymile AG +* Valentin Longchamp <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#define PRSTCFG_POWUP_UNIT_CORE_RST 0x0 +#define PRSTCFG_POWUP_UNIT_RST 0x1 +#define PRSTCFG_POWUP_RST 0x3 + +void qrio_prst (u8 bit,bool en,bool wden); +void qrio_prstcfg (u8 bit,u8 mode); + +void pci_of_setup (void *blob,bd_t *bd);
board/keymile/kmp204x/law.c new file +40 -0
@@ -0,0 +1,40 @@ +/* +* (C) Copyright 2013 Keymile AG +* Valentin Longchamp <[email protected]> +* +* Copyright 2008-2011 Freescale Semiconductor, Inc. +* +* (C) Copyright 2000 +* Wolfgang Denk, DENX Software Engineering, wd at denx.de. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/fsl_law.h> +#include <asm/mmu.h> + +struct law_entry law_table[] = { +#ifdef CONFIG_SYS_BMAN_MEM_PHYS + SET_LAW(CONFIG_SYS_BMAN_MEM_PHYS, LAW_SIZE_2M, LAW_TRGT_IF_BMAN), +#endif +#ifdef CONFIG_SYS_QMAN_MEM_PHYS + SET_LAW(CONFIG_SYS_QMAN_MEM_PHYS, LAW_SIZE_2M, LAW_TRGT_IF_QMAN), +#endif +#ifdef CONFIG_SYS_DCSRBAR_PHYS +/* Limit DCSR to 32M to access NPC Trace Buffer */ + SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_DCSR), +#endif +#ifdef CONFIG_SYS_NAND_BASE_PHYS +SET_LAW (CONFIG_SYS_NAND_BASE_PHYS ,LAW_SIZE_32K ,LAW_TRGT_IF_LBC ), +#endif +SET_LAW (CONFIG_SYS_QRIO_BASE_PHYS ,LAW_SIZE_64K ,LAW_TRGT_IF_LBC ), +#ifdef CONFIG_SYS_LBAPP1_BASE_PHYS +SET_LAW (CONFIG_SYS_LBAPP1_BASE_PHYS ,LAW_SIZE_256M ,LAW_TRGT_IF_LBC ), +#endif +#ifdef CONFIG_SYS_LBAPP2_BASE_PHYS + SET_LAW(CONFIG_SYS_LBAPP2_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC), +#endif +}; + +int num_law_entries =ARRAY_SIZE (law_table);
board/keymile/kmp204x/pbi.cfg new file +35 -0
@@ -0,0 +1,35 @@ +# +# Copyright 2012 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Refer docs/README.pblimage for more details about how-to configure +# and create PBL boot image +# + +#PBI commands +#Initialize CPC1 as 1MB SRAM +09010000 00200400 +09138000 00000000 +091380c0 00000100 +09010100 00000000 +09010104 fff0000b +09010f00 08000000 +09010000 80000000 +#Configure LAW for CPC1 +09000d00 00000000 +09000d04 fff00000 +09000d08 81000013 +09000010 00000000 +09000014 ff000000 +09000018 81000000 +#Initialize eSPI controller, default configuration is slow for eSPI to +#load data, this configuration comes from u-boot eSPI driver. +09110000 80000403 +09110020 27170008 +09110024 00100008 +09110028 00100008 +0911002c 00100008 +#Flush PBL data +09138000 00000000 +091380c0 00000000
board/keymile/kmp204x/pci.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* (C) Copyright 2013 Keymile AG +* Valentin Longchamp <[email protected]> +* +* Copyright 2007-2011 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <command.h> +#include <pci.h> +#include <asm/fsl_pci.h> +#include <libfdt.h> +#include <fdt_support.h> +#include <asm/fsl_serdes.h> + +#include "kmp204x.h" + +#define PCIE_SW_RST 14 +#define HOOPER_SW_RST 12 + +void pci_init_board (void ) +{ +qrio_prst (PCIE_SW_RST , false, false); +qrio_prst (HOOPER_SW_RST , false, false); +/* Hooper is not direcly PCIe capable */ +mdelay (50 ); +fsl_pcie_init_board (0 ); +} + +void pci_of_setup (void *blob,bd_t *bd) +{ +FT_FSL_PCI_SETUP ; +}
board/keymile/kmp204x/rcw_kmp204x.cfg new file +11 -0
@@ -0,0 +1,11 @@ +# +# Default RCW for kmp204x boards +# + +#PBL preamble and RCW header +aa55aa55 010e0100 +#64 bytes RCW data +14600000 00000000 28200000 00000000 +148E70CF CFC02000 58000000 41000000 +00000000 00000000 00000000 F4428002 +00000000 00000000 00000000 00000000
board/keymile/kmp204x/tlb.c new file +110 -0
110 lines not on this page · raw message
boards.cfg +3 -0
@@ -43,6 +43,7 @@ # Status, Arch, CPU:SPLCPU, SoC, Vendor, Board name, Target, Options, Maintainers ########################################################################################################### +<<<<<<< HEAD Active arm arm1136 - armltd integrator integratorcp_cm1136 integratorcp:CM1136 Linus Walleij <[email protected]> Active arm arm1136 mx31 - - imx31_phycore - - Active arm arm1136 mx31 davedenx - qong - Wolfgang Denk <[email protected]>
@@ -951,6 +952,7 @@ Active powerpc mpc85xx - gdsys p1022 Active powerpc mpc85xx - gdsys p1022 controlcenterd_36BIT_SDCARD_DEVELOP controlcenterd:36BIT,SDCARD,DEVELOP Dirk Eibach <[email protected]> Active powerpc mpc85xx - gdsys p1022 controlcenterd_TRAILBLAZER controlcenterd:TRAILBLAZER,SPIFLASH Dirk Eibach <[email protected]> Active powerpc mpc85xx - gdsys p1022 controlcenterd_TRAILBLAZER_DEVELOP controlcenterd:TRAILBLAZER,SPIFLASH,DEVELOP Dirk Eibach <[email protected]> +Active powerpc mpc85xx - keymile kmp204x kmlion1 kmp204x:KMLION1 Valentin Longchamp <[email protected]> Active powerpc mpc85xx - stx stxgp3 stxgp3 - Dan Malek <[email protected]> Active powerpc mpc85xx - stx stxssa stxssa stxssa Dan Malek <[email protected]> Active powerpc mpc85xx - stx stxssa stxssa_4M stxssa:STXSSA_4M Dan Malek <[email protected]>
@@ -1206,3 +1208,4 @@ Orphan powerpc mpc8xx - - genietv Orphan powerpc mpc8xx - - mbx8xx MBX - - Orphan powerpc mpc8xx - - mbx8xx MBX860T - - Orphan powerpc mpc8xx - - nx823 NX823 - - +
include/configs/km/kmp204x-common.h new file +450 -0
450 lines not on this page · raw message
include/configs/kmp204x.h new file +68 -0
68 lines not on this page · raw message
Signature · 1 line
1.8.0.1
York Sun
AppliedPATCH v4 11/11 mpc85xx: introduce the kmp204x reference design support
Quoted 49 lines · Valentin Longchamp
This patch introduces the support for Keymile's kmp204x reference design. This design is based on Freescale's P2040/P2041 SoC.
The peripherals used by this design are:
- DDR3 RAM with SPD support
- SPI NOR Flash as boot medium
- NAND Flash
- 2 PCIe busses (hosts 1 and 3)
- 3 FMAN Ethernet devices (FMAN1 DTSEC1/2/5)
- 3 Local Bus windows, with one dedicated to the QRIO reset/power mgmt FPGA
- 2 HW I2C busses
- last but not least, the mandatory serial portThe board/keymile/kmp204x code is mostly based on Freescale's P2041rdb support and was changed according to our design (that means essentially removing what is not present on the designs and a few adaptations).
There is currently only one prototype board that is based on this design and this patch also introduces it. The board is called kmlion1.
Signed-off-by Stefan Bigler <[email protected]>Signed-off-by Valentin Longchamp <[email protected]>kmp204x: update the ENV #define
The comments had to be refined as well as the total size
Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v4:
- rebased on mainline u-boot 2013.10
- fixed the name of the board to kmlion1
- changed the ENV #defines
- raised theENV_SPI_MAX_HZto 20 MHzChanges in v3:
- rebased on mainline u-boot 2013.10-rc2 (+ a few patches)
- use new licensing string
- move BCH #defines beforekeymile-common.h#include
- remove common RCW printing patch
- remove RCW printing formcheckboard()as it is now inmpc85xx/cpu.c
- new I2C #defines for new I2C subsystem
- remove patch km-powerpc: moveCONFIG_FLASH_CFI_MTDfromkm-powerpc.hsince km-powerpc is not included bykmp204x.h
- fix RCW for new IRQ/GPIO usage of kmp204x
- set netdev to eth0 since the new DTS now correctly assigns FM1 at DTSEC to eth0
Quoted 8 lines
Changes in v2:
- Remove patch "5/8 fsl: do not defineFSL_SRIO_PCIE_BOOT_MASTERfor all P2041 systems" from the series as it is not needed with current u-boot.
- fix the defines used inkmp204x/law.cfor the lbus local address windows.
- fix the header files to include Freescale's copyrights
- integrate Scott's feedback
Applied to 85xx/next, pending merge to 85xx/master.
York