Support for the kmp204x reference design
Subsystems (4)
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 7 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 8 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.
Valentin Longchamp (8):
km-powerpc: move SYS_MALLOC_LEN out of keymile-common.h
km-powerpc: move CONFIG_FLASH_CFI_MTD to km83xx-common.h
KM: fix typo in default environment
mpc8xxx: set x2 DDR3 refresh rate if SPD config requires it
fsl: do not define FSL_SRIO_PCIE_BOOT_MASTER for all P2041 systems net/fman: add a fm_enable_port function
mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into accout
mpc85xx: introduce the kmp204x reference design support
MAINTAINERS | 1 + arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c | 2 + board/keymile/common/common.c | 4 +- board/keymile/kmp204x/Makefile | 48 +++ board/keymile/kmp204x/ddr.c | 84 +++++ board/keymile/kmp204x/eth.c | 87 +++++ board/keymile/kmp204x/kmp204x.c | 307 ++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 ++ board/keymile/kmp204x/law.c | 51 +++ board/keymile/kmp204x/pbi.cfg | 51 +++ board/keymile/kmp204x/pci.c | 49 +++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 122 +++++++ boards.cfg | 1 + drivers/mtd/nand/fsl_elbc_nand.c | 6 +- drivers/net/fm/init.c | 7 + include/configs/P2041RDB.h | 1 + include/configs/km/keymile-common.h | 4 +- include/configs/km/km-powerpc.h | 1 - include/configs/km/km83xx-common.h | 4 + include/configs/km/kmp204x-common.h | 462 ++++++++++++++++++++++++ include/configs/km82xx.h | 1 + include/configs/kmp204x.h | 84 +++++ include/fm_eth.h | 1 + 24 files changed, 1414 insertions(+), 6 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 1/8 km-powerpc: move SYS_MALLOC_LEN out of keymile-common.h
It can be set to a different value for kmp204x, because we are restricted to SRAM.
--- include/configs/km/keymile-common.h | 2 -- include/configs/km/km83xx-common.h | 2 ++ include/configs/km82xx.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-)
include/configs/km/keymile-common.h +0 -2
@@ -98,8 +98,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/km83xx-common.h +2 -0
@@ -80,6 +80,8 @@/* Reserve 768 kB for Mon */ #define CONFIG_SYS_MONITOR_LEN (768 * 1024) +/* Reserve 4 MB for malloc */ +#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)/* * Initial RAM Base Address Setup
include/configs/km82xx.h +1 -0
@@ -225,6 +225,7 @@#define CONFIG_SYS_RAMBOOT #endif +#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)#define CONFIG_SYS_MONITOR_LEN (768 << 10)#define CONFIG_ENV_IS_IN_FLASH
Signature · 1 line
1.8.0.1
PATCH 2/8 km-powerpc: move CONFIG_FLASH_CFI_MTD to km83xx-common.h
In reply to Valentin LongchampThis is because kmp204x.h does not have FLASH, so this must not be defined for all powerpc boards.
--- include/configs/km/km-powerpc.h | 1 - include/configs/km/km83xx-common.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
include/configs/km/km-powerpc.h +0 -1
@@ -40,7 +40,6 @@#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10#define CONFIG_ENV_SIZE 0x04000/* Size of Environment */ -#define CONFIG_FLASH_CFI_MTD #define CONFIG_SYS_MEMTEST_START 0x00100000/* memtest works on */
include/configs/km/km83xx-common.h +2 -0
@@ -15,6 +15,8 @@#include "keymile-common.h" #include "km-powerpc.h" +#define CONFIG_FLASH_CFI_MTD +#ifndef MTDIDS_DEFAULT # define MTDIDS_DEFAULT "nor0=boot"#endif /* MTDIDS_DEFAULT */
Signature · 1 line
1.8.0.1
PATCH 3/8 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).
--- include/configs/km/keymile-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/km/keymile-common.h +1 -1
@@ -183,7 +183,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
PATCH 4/8 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.
--- arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +2 -0
@@ -320,6 +320,8 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,* = 3.9 us at ext temperature range */ pdimm->refresh_rate_ps =7800000 ; +if ((spd->therm_ref_opt &0x1 ) && !(spd->therm_ref_opt &0x2 )) + pdimm->refresh_rate_ps =3900000 ;/* * min four active window delay time
Signature · 1 line
1.8.0.1
PATCH 4/8 mpc8xxx: set x2 DDR3 refresh rate if SPD config requires it
Quoted 16 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.
Signed-off-by Valentin Longchamp <[email protected]>---
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c| 2 ++1 file changed, 2 insertions(+)arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +0
-0
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd, · line 327
Quoted 8 lines
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +2
-0@@ -320,6 +320,8 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,* = 3.9 us at ext temperature range */ pdimm->refresh_rate_ps =7800000 ; +if ((spd->therm_ref_opt &0x1 ) && !(spd->therm_ref_opt &0x2 )) + pdimm->refresh_rate_ps =3900000 ;/* * min four active window delay time
Has this been verified on a board?
This looks half-way done. If the module supports extended temperature range, the MR2 should be adjusted to fit the module.
York
PATCH 4/8 mpc8xxx: set x2 DDR3 refresh rate if SPD config requires it
Quoted 22 lines · York Sun
Quoted 21 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.
Signed-off-by Valentin Longchamp <[email protected]>---
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c| 2 ++1 file changed, 2 insertions(+)arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +2
-0@@ -320,6 +320,8 @@ ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd,* = 3.9 us at ext temperature range */ pdimm->refresh_rate_ps =7800000 ; +if ((spd->therm_ref_opt &0x1 ) && !(spd->therm_ref_opt &0x2 )) + pdimm->refresh_rate_ps =3900000 ;
Quoted 5 lines
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c ddr_compute_dimm_parameters(const ddr3_spd_eeprom_t *spd, · line 327
Quoted 3 lines
arch/powerpc/cpu/mpc8xxx/ddr/ddr3_dimm_params.c +0
-0/* * min four active window delay time Has this been verified on a board?
Yes, we have been using it successfully for a long time on our board.
Quoted 4 lines
This looks half-way done. If the module supports extended temperature range, the MR2 should be adjusted to fit the module.
You are right, as the SPD content states it: "If SPD Byte 31 bit 0 = 1, then the extended temperature range from 85-95 ?C is supported and the SDRAM MR2 bit A7 may be set to 1."
I will have a look at that.
Valentin
PATCH 5/8 fsl: do not define FSL_SRIO_PCIE_BOOT_MASTER for all P2041 systems
In reply to Valentin LongchampIf this #define stays in config_mpc85xx.h, the P2041 based boards must define a lot of SRIO values even if they do not implement a SRIO device.
The #define is moved into the P2041RDB board config file where it is used.
--- include/configs/P2041RDB.h | 1 + 1 file changed, 1 insertion(+)
include/configs/P2041RDB.h +1 -0
@@ -399,6 +399,7 @@ unsigned long get_board_sys_clk(unsigned long dummy);* for slave u-boot IMAGE instored in master memory space, * PHYS must be aligned based on the SIZE */ +#define CONFIG_SYS_FSL_SRIO_PCIE_BOOT_MASTER #define CONFIG_SRIO_PCIE_BOOT_IMAGE_MEM_PHYS 0xfef080000ull#define CONFIG_SRIO_PCIE_BOOT_IMAGE_MEM_BUS1 0xfff80000ull#define CONFIG_SRIO_PCIE_BOOT_IMAGE_SIZE 0x80000/* 512K */
Signature · 1 line
1.8.0.1
PATCH 5/8 fsl: do not define FSL_SRIO_PCIE_BOOT_MASTER for all P2041 systems
Quoted 17 lines · Valentin Longchamp
If this #define stays in
config_mpc85xx.h, the P2041 based boards must define a lot of SRIO values even if they do not implement a SRIO device.The #define is moved into the P2041RDB board config file where it is used.
Signed-off-by Valentin Longchamp <[email protected]>---
include/configs/P2041RDB.h| 1 +1 file changed, 1 insertion(+)include/configs/P2041RDB.h +0
-0
include/configs/P2041RDB.h unsigned long get_board_sys_clk(unsigned long dummy); · line 405
Quoted 7 lines
include/configs/P2041RDB.h +1
-0@@ -399,6 +399,7 @@ unsigned long get_board_sys_clk(unsigned long dummy);* for slave u-boot IMAGE instored in master memory space, * PHYS must be aligned based on the SIZE */ +#define CONFIG_SYS_FSL_SRIO_PCIE_BOOT_MASTER #define CONFIG_SRIO_PCIE_BOOT_IMAGE_MEM_PHYS 0xfef080000ull#define CONFIG_SRIO_PCIE_BOOT_IMAGE_MEM_BUS1 0xfff80000ull#define CONFIG_SRIO_PCIE_BOOT_IMAGE_SIZE 0x80000/* 512K */
I failed to see what problem this patch fixes. Maybe you were using an older copy of u-boot?
York
PATCH 5/8 fsl: do not define FSL_SRIO_PCIE_BOOT_MASTER for all P2041 systems
Quoted 13 lines · York Sun
Quoted 12 lines · Valentin Longchamp
If this #define stays in
config_mpc85xx.h, the P2041 based boards must define a lot of SRIO values even if they do not implement a SRIO device.The #define is moved into the P2041RDB board config file where it is used.
Signed-off-by Valentin Longchamp <[email protected]>---
include/configs/P2041RDB.h| 1 +1 file changed, 1 insertion(+)
Quoted 16 lines
include/configs/P2041RDB.h unsigned long get_board_sys_clk(unsigned long dummy); · line 405
Quoted 12 lines
include/configs/P2041RDB.h +1
-0@@ -399,6 +399,7 @@ unsigned long get_board_sys_clk(unsigned long dummy);* for slave u-boot IMAGE instored in master memory space, * PHYS must be aligned based on the SIZE */ +#define CONFIG_SYS_FSL_SRIO_PCIE_BOOT_MASTER #define CONFIG_SRIO_PCIE_BOOT_IMAGE_MEM_PHYS 0xfef080000ull#define CONFIG_SRIO_PCIE_BOOT_IMAGE_MEM_BUS1 0xfff80000ull#define CONFIG_SRIO_PCIE_BOOT_IMAGE_SIZE 0x80000/* 512K */ I failed to see what problem this patch fixes. Maybe you were using an older copy of u-boot?
I developped all this with an earlier version of u-boot and I missed this one as I rebased. You are right, this is not needed and fixes nothing.
Valentin
PATCH 6/8 net/fman: add a fm_enable_port function
In reply to Valentin LongchampThis can be useful if we want to disable an interface in u-boot and later reenable them, so that it looks available when trying to fix the FDT or for the kernel.
--- drivers/net/fm/init.c | 7 +++++++ include/fm_eth.h | 1 + 2 files changed, 8 insertions(+)
drivers/net/fm/init.c +7 -0
@@ -158,6 +158,13 @@ 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 ; +} +void fm_info_set_mdio (enum fm_port port,struct mii_dev *bus) {int i =fm_port_to_index (port);
include/fm_eth.h +1 -0
@@ -162,5 +162,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
PATCH 6/8 net/fman: add a fm_enable_port function
Quoted 34 lines · Valentin Longchamp
This can be useful if we want to disable an interface in u-boot and later reenable them, so that it looks available when trying to fix the FDT or for the kernel.
Signed-off-by Valentin Longchamp <[email protected]>---
drivers/net/fm/init.c| 7 +++++++include/fm_eth.h | 1 + 2 files changed, 8 insertions(+)drivers/net/fm/init.c +7
-0@@ -158,6 +158,13 @@ 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 ; +} +void fm_info_set_mdio (enum fm_port port,struct mii_dev *bus) {int i =fm_port_to_index (port);include/fm_eth.h +0
-0
include/fm_eth.h void fm_info_set_phy_address(enum fm_port port, int address); · line 166
Quoted 5 lines
include/fm_eth.h +1
-0@@ -162,5 +162,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);
Is this function called somewhere?
York
PATCH 6/8 net/fman: add a fm_enable_port function
Quoted 34 lines · York Sun
Quoted 33 lines · Valentin Longchamp
This can be useful if we want to disable an interface in u-boot and later reenable them, so that it looks available when trying to fix the FDT or for the kernel.
Signed-off-by Valentin Longchamp <[email protected]>---
drivers/net/fm/init.c| 7 +++++++include/fm_eth.h | 1 + 2 files changed, 8 insertions(+)drivers/net/fm/init.c +7
-0@@ -158,6 +158,13 @@ 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 ; +} +void fm_info_set_mdio (enum fm_port port,struct mii_dev *bus) {int i =fm_port_to_index (port);include/fm_eth.h +0
-0
Quoted 9 lines
include/fm_eth.h void fm_info_set_phy_address(enum fm_port port, int address); · line 166
Quoted 6 lines
include/fm_eth.h +1
-0@@ -162,5 +162,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);Is this function called somewhere?
Yes it is used in the patch 8/8 of this series.
Valentin
PATCH 7/8 mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into accout
In reply to Valentin LongchampNAND_ECC_SOFT was the only option available while the SOFT_BCH option may also be used.
--- drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mtd/nand/fsl_elbc_nand.c +5 -1
@@ -771,8 +771,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
PATCH 7/8 mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into accout
Quoted 7 lines · Valentin Longchamp
NAND_ECC_SOFTwas the only option available while theSOFT_BCHoption may also be used.Signed-off-by Valentin Longchamp <[email protected]>--- drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Is this for use with http://patchwork.ozlabs.org/patch/168855/ or do you have a 2K-page NAND that requires more than 1 bit of ECC correction?
-Scott
PATCH 7/8 mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into accout
Quoted 9 lines · Scott Wood
Quoted 7 lines · Valentin Longchamp
NAND_ECC_SOFTwas the only option available while theSOFT_BCHoption may also be used.Signed-off-by Valentin Longchamp <[email protected]>--- drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 5 lines
Acked-by Scott Wood <[email protected]>Is this for use with http://patchwork.ozlabs.org/patch/168855/ or do you have a 2K-page NAND that requires more than 1 bit of ECC correction?
We have a 2K-page NAND but we have found out that we need more than 1 bit of ECC correction otherwise with some suppliers we sometimes see uncorrectable bitflips.
Valentin
PATCH 8/8 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.
--- MAINTAINERS | 1 + board/keymile/common/common.c | 4 +- board/keymile/kmp204x/Makefile | 48 ++++ board/keymile/kmp204x/ddr.c | 84 +++++++ board/keymile/kmp204x/eth.c | 87 +++++++ board/keymile/kmp204x/kmp204x.c | 307 ++++++++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 +++ board/keymile/kmp204x/law.c | 51 ++++ board/keymile/kmp204x/pbi.cfg | 51 ++++ board/keymile/kmp204x/pci.c | 49 ++++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 122 +++++++++ boards.cfg | 1 + include/configs/km/kmp204x-common.h | 462 ++++++++++++++++++++++++++++++++++ include/configs/kmp204x.h | 84 +++++++ 15 files changed, 1392 insertions(+), 1 deletion(-) 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
MAINTAINERS +1 -0
@@ -778,6 +778,7 @@ Valentin Longchamp <[email protected]> mgcoge3un ARM926EJS (Kirkwood SoC) kmcoge5un ARM926EJS (Kirkwood SoC) portl2 ARM926EJS (Kirkwood SoC) + kmcoge4 MPC85xx (P2041 SoC) Nishanth Menon <[email protected]>
board/keymile/common/common.c +3 -1
@@ -94,7 +94,7 @@ int set_km_env(void) } #if defined(CONFIG_SYS_I2C_INIT_BOARD) -#if !defined(CONFIG_MPC83xx) +#if !defined(CONFIG_MPC83xx) && !defined(CONFIG_PPC_P2041) static void i2c_write_start_seq(void) { set_sda(1);
@@ -183,6 +183,7 @@ void i2c_init_board(void) }#endif +#ifndef CONFIG_KMP204X int board_eth_init (bd_t *bis) {if (ethernet_present ())
@@ -190,6 +191,7 @@ int board_eth_init(bd_t *bis) return -1; } +#endif /* * do_setboardid command
board/keymile/kmp204x/Makefile new file +48 -0
48 lines not on this page · raw message
board/keymile/kmp204x/ddr.c new file +84 -0
84 lines not on this page · raw message
board/keymile/kmp204x/eth.c new file +87 -0
87 lines not on this page · raw message
board/keymile/kmp204x/kmp204x.c new file +307 -0
307 lines not on this page · raw message
board/keymile/kmp204x/kmp204x.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* (C) Copyright 2013 Keymile AG +* Valentin Longchamp <[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. +* +* 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 +*/ + +#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 +51 -0
51 lines not on this page · raw message
board/keymile/kmp204x/pbi.cfg new file +51 -0
51 lines not on this page · raw message
board/keymile/kmp204x/pci.c new file +49 -0
49 lines not on this page · raw message
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 F4429000 +00000000 00000000 00000000 00000000
board/keymile/kmp204x/tlb.c new file +122 -0
122 lines not on this page · raw message
boards.cfg +1 -0
@@ -744,6 +744,7 @@ tuge1 powerpc mpc83xx km83xx keymile tuxx1 powerpc mpc83xx km83xx keymile - tuxx1:TUXX1 kmopti2 powerpc mpc83xx km83xx keymile - tuxx1:KMOPTI2 kmsupx5 powerpc mpc83xx km83xx keymile - tuxx1:KMSUPX5 +kmlion1 powerpc mpc85xx kmp204x keymile - kmp204x:KMLION1 sbc8548 powerpc mpc85xx sbc8548 - - sbc8548 sbc8548_PCI_33 powerpc mpc85xx sbc8548 - - sbc8548:PCI,33 sbc8548_PCI_33_PCIE powerpc mpc85xx sbc8548 - - sbc8548:PCI,33,PCIE
include/configs/km/kmp204x-common.h new file +462 -0
462 lines not on this page · raw message
include/configs/kmp204x.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
1.8.0.1
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 14 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 port
Quoted 3 lines
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).
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Quoted 53 lines
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]>--- MAINTAINERS | 1 + board/keymile/common/common.c | 4 +- board/keymile/kmp204x/Makefile | 48 ++++ board/keymile/kmp204x/ddr.c | 84 +++++++ board/keymile/kmp204x/eth.c | 87 +++++++ board/keymile/kmp204x/kmp204x.c | 307 ++++++++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 +++ board/keymile/kmp204x/law.c | 51 ++++ board/keymile/kmp204x/pbi.cfg | 51 ++++ board/keymile/kmp204x/pci.c | 49 ++++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 122 +++++++++ boards.cfg | 1 + include/configs/km/kmp204x-common.h | 462 ++++++++++++++++++++++++++++++++++ include/configs/kmp204x.h | 84 +++++++ 15 files changed, 1392 insertions(+), 1 deletion(-) 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.hMAINTAINERS +1
-0@@ -778,6 +778,7 @@ Valentin Longchamp <[email protected]> mgcoge3un ARM926EJS (Kirkwood SoC) kmcoge5un ARM926EJS (Kirkwood SoC) portl2 ARM926EJS (Kirkwood SoC) + kmcoge4 MPC85xx (P2041 SoC) Nishanth Menon <[email protected]>board/keymile/common/common.c +0
-0
board/keymile/common/common.c int set_km_env(void) · line 97
Quoted 5 lines
board/keymile/common/common.c +1
-1@@ -94,7 +94,7 @@ int set_km_env(void) }#if defined(CONFIG_SYS_I2C_INIT_BOARD ) -#if !defined(CONFIG_MPC83xx) +#if !defined(CONFIG_MPC83xx) && !defined(CONFIG_PPC_P2041 )
Perhaps you should check for when you do want to run this code, rather than when you don't.
board/keymile/common/common.c void i2c_init_board(void) · line 187
Quoted 9 lines
board/keymile/common/common.c +1
-0static void i2c_write_start_seq (void ) {set_sda (1 );@@ -183,6 +183,7 @@ void i2c_init_board(void) }#endif +#ifndef CONFIG_KMP204X int board_eth_init (bd_t *bis)
Likewise.
board/keymile/common/common.c void i2c_init_board(void)
Quoted 4 lines
board/keymile/common/common.c +4
-0+/* TODO: implement the I2C functions */ +void i2c_write_start_seq (void ){ +return ; +}
Opening brace goes on its own line for function definitions.
board/keymile/common/common.c
Quoted 4 lines
board/keymile/common/common.c +4
-0+if (en) + prst &= ~(1 <<bit); +else + prst |= (1 <<bit);
Spaces around binary operators such as <<
board/keymile/common/common.c
Quoted 3 lines
board/keymile/common/common.c +3
-0+#ifdef CONFIG_SYS_NAND_BASE_PHYS + SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC), +#endif
The NAND window is 8K. There's no reason for the LAW to be more than the minimum 32K.
Quoted 48 lines
board/keymile/kmp204x/tlb.c new file +42
-0@@ -0,0 +1,122 @@ +/* +* (C) Copyright 2013 Keymile AG +* Valentin Longchamp <[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. +* +* 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., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301 USA +*/ + +#include <common.h> +#include <asm/mmu.h> + +struct fsl_e_tlb_entry tlb_table[] = { +/* TLB 0 - for temp stack in cache */ +SET_TLB_ENTRY (0 ,CONFIG_SYS_INIT_RAM_ADDR , +CONFIG_SYS_INIT_RAM_ADDR_PHYS , +MAS3_SW |MAS3_SR ,0 , +0 ,0 ,BOOKE_PAGESZ_4K ,0 ), +SET_TLB_ENTRY (0 ,CONFIG_SYS_INIT_RAM_ADDR +4 *1024 , +CONFIG_SYS_INIT_RAM_ADDR_PHYS +4 *1024 , +MAS3_SW |MAS3_SR ,0 , +0 ,0 ,BOOKE_PAGESZ_4K ,0 ), +SET_TLB_ENTRY (0 ,CONFIG_SYS_INIT_RAM_ADDR +8 *1024 , +CONFIG_SYS_INIT_RAM_ADDR_PHYS +8 *1024 , +MAS3_SW |MAS3_SR ,0 , +0 ,0 ,BOOKE_PAGESZ_4K ,0 ), + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
board/keymile/kmp204x/tlb.c line 52
Quoted 10 lines
board/keymile/kmp204x/tlb.c new file +10
-0+ MAS3_SW|MAS3_SR, 0, + 0, 0, BOOKE_PAGESZ_4K, 0), +/* TLB 1 */ +/* *I*** - Covers boot page */ +/* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the +* SRAM is at 0xfff00000, it covered the 0xfffff000. +*/ +SET_TLB_ENTRY (1 ,CONFIG_SYS_INIT_L3_ADDR ,CONFIG_SYS_INIT_L3_ADDR , +MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , + 0, 0, BOOKE_PAGESZ_1M, 1),
What does that "covers boot page" comment refer to?
Why is L3SRAM I+G?
board/keymile/kmp204x/tlb.c line 119
Quoted 10 lines
board/keymile/kmp204x/tlb.c new file +10
-0+#ifdef CONFIG_SYS_NAND_BASE +/* +* *I*G - NAND +* entry 14 and 15 has been used hard coded, they will be disabled +* in cpu_init_f, so we use entry 16 for nand. +*/ + SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 16, BOOKE_PAGESZ_1M, 1), +#endif
Again, NAND is an 8K window. Don't set MAS3_SX.
boards.cfg tuge1 powerpc mpc83xx km83xx keymile · line 747
Quoted 12 lines
board/keymile/kmp204x/tlb.c new file +3
-0+}; + +int num_tlb_entries =ARRAY_SIZE (tlb_table);boards.cfg +1
-0@@ -744,6 +744,7 @@ tuge1 powerpc mpc83xx km83xx keymile tuxx1 powerpc mpc83xx km83xx keymile - tuxx1:TUXX1 kmopti2 powerpc mpc83xx km83xx keymile - tuxx1:KMOPTI2 kmsupx5 powerpc mpc83xx km83xx keymile - tuxx1:KMSUPX5 +kmlion1 powerpc mpc85xx kmp204x keymile - kmp204x:KMLION1
Is it kmlion1 or km204x? The target name should match what the board prints out on boot.
Quoted 11 lines
boards.cfg +10
-0+#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE} +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_MTD_NAND_VERIFY_WRITE +#define CONFIG_CMD_NAND +#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) + +#define CONFIG_NAND_ECC_BCH +#define CONFIG_BCH +/* NAND flash config */ +#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
boards.cfg tuge1 powerpc mpc83xx km83xx keymile
Quoted 10 lines
boards.cfg +10
-0+ | BR_PS_8 /* Port Size = 8 bit */ \ + | BR_MS_FCM /* MSEL = FCM */ \ + | BR_V) /* valid */ + +#define CONFIG_SYS_NAND_OR_PRELIM (OR_AM_256KB /* length 256K */ \ + | OR_FCM_BCTLD /* LBCTL not ass */ \ + | OR_FCM_SCY_1 /* 1 clk wait cycle */ \ + | OR_FCM_RST /* 1 clk read setup */ \ + | OR_FCM_PGS /* Large Page 128k */ \ + | OR_FCM_CST) /* 0.25 command setup */
What does "large page 128k" mean? 128k is the block size, not the page size.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 15 lines · Scott Wood
Quoted 14 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 port
Quoted 7 lines
Quoted 3 lines
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).
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Well, I had tried to come a first proposal that factored shared code but I was advised to copy the code: [1]. For the copyrights I will fix it.
[1]
Quoted 56 lines
Quoted 56 lines
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]>--- MAINTAINERS | 1 + board/keymile/common/common.c | 4 +- board/keymile/kmp204x/Makefile | 48 ++++ board/keymile/kmp204x/ddr.c | 84 +++++++ board/keymile/kmp204x/eth.c | 87 +++++++ board/keymile/kmp204x/kmp204x.c | 307 ++++++++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 +++ board/keymile/kmp204x/law.c | 51 ++++ board/keymile/kmp204x/pbi.cfg | 51 ++++ board/keymile/kmp204x/pci.c | 49 ++++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 122 +++++++++ boards.cfg | 1 + include/configs/km/kmp204x-common.h | 462 ++++++++++++++++++++++++++++++++++ include/configs/kmp204x.h | 84 +++++++ 15 files changed, 1392 insertions(+), 1 deletion(-) 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.hMAINTAINERS +1
-0@@ -778,6 +778,7 @@ Valentin Longchamp <[email protected]> mgcoge3un ARM926EJS (Kirkwood SoC) kmcoge5un ARM926EJS (Kirkwood SoC) portl2 ARM926EJS (Kirkwood SoC) + kmcoge4 MPC85xx (P2041 SoC) Nishanth Menon <[email protected]>board/keymile/common/common.c +0
-0@@ -94,7 +94,7 @@ int set_km_env(void) }
Quoted 6 lines
board/keymile/common/common.c int set_km_env(void) · line 97
Quoted 3 lines
board/keymile/common/common.c +1
-1#if defined(CONFIG_SYS_I2C_INIT_BOARD ) -#if !defined(CONFIG_MPC83xx) +#if !defined(CONFIG_MPC83xx) && !defined(CONFIG_PPC_P2041 )Perhaps you should check for when you do want to run this code, rather than when you don't.
No, there are more cases where this is needed than not needed.
Quoted 8 lines
Quoted 8 lines
board/keymile/common/common.c +0
-0static void i2c_write_start_seq (void ) {set_sda (1 );@@ -183,6 +183,7 @@ void i2c_init_board(void) }#endif
Quoted 4 lines
board/keymile/common/common.c void i2c_init_board(void) · line 187
Quoted 2 lines
board/keymile/common/common.c +1
-0+#ifndef CONFIG_KMP204X int board_eth_init (bd_t *bis)Likewise.
Same as above.
Quoted 7 lines
board/keymile/common/common.c void i2c_init_board(void)
Quoted 5 lines
board/keymile/common/common.c +4
-0+/* TODO: implement the I2C functions */ +void i2c_write_start_seq (void ){ +return ; +}Opening brace goes on its own line for function definitions.
OK
Quoted 7 lines
board/keymile/common/common.c
Quoted 5 lines
board/keymile/common/common.c +4
-0+if (en) + prst &= ~(1 <<bit); +else + prst |= (1 <<bit);Spaces around binary operators such as <<
OK
Quoted 7 lines
board/keymile/common/common.c
Quoted 4 lines
board/keymile/common/common.c +3
-0+#ifdef CONFIG_SYS_NAND_BASE_PHYS + SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC), +#endif The NAND window is 8K. There's no reason for the LAW to be more than the minimum 32K.
OK, I agree and will test this.
Quoted 62 lines
Quoted 49 lines
board/keymile/kmp204x/tlb.c new file +42
-0@@ -0,0 +1,122 @@ +/* +* (C) Copyright 2013 Keymile AG +* Valentin Longchamp <[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. +* +* 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., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301 USA +*/ + +#include <common.h> +#include <asm/mmu.h> + +struct fsl_e_tlb_entry tlb_table[] = { +/* TLB 0 - for temp stack in cache */ +SET_TLB_ENTRY (0 ,CONFIG_SYS_INIT_RAM_ADDR , +CONFIG_SYS_INIT_RAM_ADDR_PHYS , +MAS3_SW |MAS3_SR ,0 , +0 ,0 ,BOOKE_PAGESZ_4K ,0 ), +SET_TLB_ENTRY (0 ,CONFIG_SYS_INIT_RAM_ADDR +4 *1024 , +CONFIG_SYS_INIT_RAM_ADDR_PHYS +4 *1024 , +MAS3_SW |MAS3_SR ,0 , +0 ,0 ,BOOKE_PAGESZ_4K ,0 ), +SET_TLB_ENTRY (0 ,CONFIG_SYS_INIT_RAM_ADDR +8 *1024 , +CONFIG_SYS_INIT_RAM_ADDR_PHYS +8 *1024 , +MAS3_SW |MAS3_SR ,0 , +0 ,0 ,BOOKE_PAGESZ_4K ,0 ), + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,board/keymile/kmp204x/tlb.c line 52
Quoted 10 lines
board/keymile/kmp204x/tlb.c new file +10
-0+ MAS3_SW|MAS3_SR, 0, + 0, 0, BOOKE_PAGESZ_4K, 0), +/* TLB 1 */ +/* *I*** - Covers boot page */ +/* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the +* SRAM is at 0xfff00000, it covered the 0xfffff000. +*/ +SET_TLB_ENTRY (1 ,CONFIG_SYS_INIT_L3_ADDR ,CONFIG_SYS_INIT_L3_ADDR , +MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet SYS_RAMBOOT boot scenario since it's also the way our board boots.
Quoted 4 lines
Quoted 4 lines
board/keymile/kmp204x/tlb.c new file +4
-0+#ifdef CONFIG_SYS_NAND_BASE +/* +* *I*G - NAND +* entry 14 and 15 has been used hard coded, they will be disabled
Quoted 8 lines
board/keymile/kmp204x/tlb.c line 119
Quoted 6 lines
board/keymile/kmp204x/tlb.c new file +6
-0+* in cpu_init_f, so we use entry 16 for nand. +*/ + SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 16, BOOKE_PAGESZ_1M, 1), +#endif Again, NAND is an 8K window. Don't set
MAS3_SX.
OK
Quoted 16 lines
boards.cfg tuge1 powerpc mpc83xx km83xx keymile · line 747
Quoted 13 lines
board/keymile/kmp204x/tlb.c new file +3
-0+}; + +int num_tlb_entries =ARRAY_SIZE (tlb_table);boards.cfg +1
-0@@ -744,6 +744,7 @@ tuge1 powerpc mpc83xx km83xx keymile tuxx1 powerpc mpc83xx km83xx keymile - tuxx1:TUXX1 kmopti2 powerpc mpc83xx km83xx keymile - tuxx1:KMOPTI2 kmsupx5 powerpc mpc83xx km83xx keymile - tuxx1:KMSUPX5 +kmlion1 powerpc mpc85xx kmp204x keymile - kmp204x:KMLION1Is it kmlion1 or km204x? The target name should match what the board prints out on boot.
It is the kmlion1 board that is based on the kmp204x "generic" design.
Quoted 10 lines
Quoted 10 lines
boards.cfg +8
-0+#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE} +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_MTD_NAND_VERIFY_WRITE +#define CONFIG_CMD_NAND +#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) + +#define CONFIG_NAND_ECC_BCH +#define CONFIG_BCH
Quoted 16 lines
boards.cfg
Quoted 12 lines
boards.cfg +12
-0+/* NAND flash config */ +#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \ + | BR_PS_8 /* Port Size = 8 bit */ \ + | BR_MS_FCM /* MSEL = FCM */ \ + | BR_V) /* valid */ + +#define CONFIG_SYS_NAND_OR_PRELIM (OR_AM_256KB /* length 256K */ \ + | OR_FCM_BCTLD /* LBCTL not ass */ \ + | OR_FCM_SCY_1 /* 1 clk wait cycle */ \ + | OR_FCM_RST /* 1 clk read setup */ \ + | OR_FCM_PGS /* Large Page 128k */ \ + | OR_FCM_CST) /* 0.25 command setup */What does "large page 128k" mean? 128k is the block size, not the page size.
OK
Valentin
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 20 lines · Valentin Longchamp
Quoted 19 lines · Scott Wood
Quoted 17 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).
Quoted 9 lines
Quoted 3 lines
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Well, I had tried to come a first proposal that factored shared code but I was advised to copy the code: [1]. For the copyrights I will fix it.
[1]
Did you mean to cite something here?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
board/keymile/common/common.c +0
-0@@ -94,7 +94,7 @@ int set_km_env(void) }
Quoted 8 lines
Quoted 6 lines
board/keymile/common/common.c int set_km_env(void) · line 97
Quoted 3 lines
board/keymile/common/common.c +1
-1#if defined(CONFIG_SYS_I2C_INIT_BOARD ) -#if !defined(CONFIG_MPC83xx) +#if !defined(CONFIG_MPC83xx) && !defined(CONFIG_PPC_P2041 )Perhaps you should check for when you do want to run this code, rather than when you don't.
No, there are more cases where this is needed than not needed.
Doesn't matter; it's still less readable and a maintenance pain. Introduce a symbol that describes the situation where you want to run this code, so you don't have to repeat the list each time.
Quoted 11 lines
Quoted 11 lines
board/keymile/common/common.c int set_km_env(void)
Quoted 8 lines
board/keymile/common/common.c +8
-0+/* TLB 1 */ +/* *I*** - Covers boot page */ +/* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the +* SRAM is at 0xfff00000, it covered the 0xfffff000. +*/ +SET_TLB_ENTRY (1 ,CONFIG_SYS_INIT_L3_ADDR ,CONFIG_SYS_INIT_L3_ADDR , +MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.
York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
board/keymile/common/common.c +1
-0+int num_tlb_entries =ARRAY_SIZE (tlb_table);boards.cfg +0
-0Quoted 8 lines
boards.cfg tuge1 powerpc mpc83xx km83xx keymile · line 747
Quoted 5 lines
boards.cfg +1
-0@@ -744,6 +744,7 @@ tuge1 powerpc mpc83xx km83xx keymile tuxx1 powerpc mpc83xx km83xx keymile - tuxx1:TUXX1 kmopti2 powerpc mpc83xx km83xx keymile - tuxx1:KMOPTI2 kmsupx5 powerpc mpc83xx km83xx keymile - tuxx1:KMSUPX5 +kmlion1 powerpc mpc85xx kmp204x keymile - kmp204x:KMLION1Is it kmlion1 or km204x? The target name should match what the board prints out on boot.
Quoted 1 line
It is the kmlion1 board that is based on the kmp204x "generic" design.
Then U-Boot should print out "kmlion1" as its board name.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
board/keymile/kmp204x/tlb.c line 52
Quoted 8 lines
board/keymile/kmp204x/tlb.c new file +8
-0+/* TLB 1 */ +/* *I*** - Covers boot page */ +/* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the +* SRAM is at 0xfff00000, it covered the 0xfffff000. +*/ +SET_TLB_ENTRY (1 ,CONFIG_SYS_INIT_L3_ADDR ,CONFIG_SYS_INIT_L3_ADDR , +MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Why is L3SRAM I+G?
Quoted 7 lines
Quoted 2 lines
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
+#define CONFIG_SYS_RAMBOOT
+#define CONFIG_RAMBOOT_PBL
+#define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASE
and
+/*
+ * Config the L3 Cache as L3 SRAM
+ */
+#define CONFIG_SYS_INIT_L3_ADDR CONFIG_RAMBOOT_TEXT_BASE
+#define CONFIG_SYS_INIT_L3_ADDR_PHYS (0xf00000000ull | \
+ CONFIG_RAMBOOT_TEXT_BASE)
+#define CONFIG_SYS_L3_SIZE (1024 << 10)
+#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR + CONFIG_SYS_L3_SIZE)
York
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 24 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 17 lines
Quoted 16 lines
Quoted 11 lines
board/keymile/kmp204x/tlb.c line 52
Quoted 8 lines
board/keymile/kmp204x/tlb.c new file +8
-0+/* TLB 1 */ +/* *I*** - Covers boot page */ +/* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the +* SRAM is at 0xfff00000, it covered the 0xfffff000. +*/ +SET_TLB_ENTRY (1 ,CONFIG_SYS_INIT_L3_ADDR ,CONFIG_SYS_INIT_L3_ADDR , +MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.
Quoted 7 lines
Quoted 4 lines
York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
At the very least this mapping can't be *I*G and *I** at the same time.
Quoted 14 lines
include/configs/km/kmp204x-common.h new file +3
-0+#define CONFIG_SYS_RAMBOOT +#define CONFIG_RAMBOOT_PBL +#define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASEand
include/configs/km/kmp204x-common.h new file +8
-0+/* +* Config the L3 Cache as L3 SRAM +*/ +#define CONFIG_SYS_INIT_L3_ADDR CONFIG_RAMBOOT_TEXT_BASE +#define CONFIG_SYS_INIT_L3_ADDR_PHYS (0xf00000000ull | \ + CONFIG_RAMBOOT_TEXT_BASE) +#define CONFIG_SYS_L3_SIZE (1024 << 10) +#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR +
Quoted 1 line
CONFIG_SYS_L3_SIZE)
...and this doesn't cover the boot page.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 44 lines · Scott Wood
Quoted 24 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 17 lines
Quoted 16 lines
Quoted 11 lines
board/keymile/kmp204x/tlb.c line 52
Quoted 8 lines
board/keymile/kmp204x/tlb.c new file +8
-0+/* TLB 1 */ +/* *I*** - Covers boot page */ +/* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the +* SRAM is at 0xfff00000, it covered the 0xfffff000. +*/ +SET_TLB_ENTRY (1 ,CONFIG_SYS_INIT_L3_ADDR ,CONFIG_SYS_INIT_L3_ADDR , +MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.Quoted 7 lines
Quoted 4 lines
York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
At the very least this mapping can't be *I*G and *I** at the same time.
Quoted 6 lines
include/configs/km/kmp204x-common.h new file +3
-0+#define CONFIG_SYS_RAMBOOT +#define CONFIG_RAMBOOT_PBL +#define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASEand
Quoted 11 lines
Quoted 9 lines
include/configs/km/kmp204x-common.h new file +8
-0+/* +* Config the L3 Cache as L3 SRAM +*/ +#define CONFIG_SYS_INIT_L3_ADDR CONFIG_RAMBOOT_TEXT_BASE +#define CONFIG_SYS_INIT_L3_ADDR_PHYS (0xf00000000ull | \ + CONFIG_RAMBOOT_TEXT_BASE) +#define CONFIG_SYS_L3_SIZE (1024 << 10) +#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR +
CONFIG_SYS_L3_SIZE)...and this doesn't cover the boot page.
Also, can you answer the question about why the L3 SRAM mapping is cache-inhibited?
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 28 lines · Scott Wood
Quoted 27 lines · Scott Wood
Quoted 26 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 19 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ /* TLB 1 */ + /* *I*** - Covers boot page */ + /* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the + * SRAM is at 0xfff00000, it covered the 0xfffff000. + */ + SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
I think this entry replaces the default TLB out of reset and it does cover the boot page 0xfffff000~0xffffffff. It is not unique to this platform. You can find many similar existing code.
Quoted 2 lines
Quoted 2 lines
At the very least this mapping can't be *I*G and *I** at the same time.
I agree the G bit shouldn't be set here.
Quoted 19 lines
Quoted 7 lines
Quoted 7 lines
(quoted diff) +3
-0+#define CONFIG_SYS_RAMBOOT +#define CONFIG_RAMBOOT_PBL +#define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASEand
Quoted 11 lines
Quoted 9 lines
(quoted diff) +8
-0+/* + * Config the L3 Cache as L3 SRAM + */ +#define CONFIG_SYS_INIT_L3_ADDR CONFIG_RAMBOOT_TEXT_BASE +#define CONFIG_SYS_INIT_L3_ADDR_PHYS (0xf00000000ull | \ + CONFIG_RAMBOOT_TEXT_BASE) +#define CONFIG_SYS_L3_SIZE (1024 << 10) +#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR +
CONFIG_SYS_L3_SIZE)...and this doesn't cover the boot page.
Quoted 2 lines
Also, can you answer the question about why the L3 SRAM mapping is cache-inhibited?
I suspect this is the idea carried from early NAND boot implementation. You are mostly familiar with NAND and SPL boot, can you examine if we can turn on the cache for these cases?
York
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 32 lines · York Sun
Quoted 31 lines · Scott Wood
Quoted 30 lines · Scott Wood
Quoted 29 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 21 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ /* TLB 1 */ + /* *I*** - Covers boot page */ + /* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the + * SRAM is at 0xfff00000, it covered the 0xfffff000. + */ + SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
I think this entry replaces the default TLB out of reset and it does cover the boot page 0xfffff000~0xffffffff.
That's not what the comment appears to say (unless you read the word "cover" in a non-intuitive and ambiguous way). These comments generally talk about what the new TLB is, not what is being replaced.
Quoted 1 line
It is not unique to this platform. You can find many similar existing code.
I know that. That's why I'm asking you to explain it rather than Valentin. :-)
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
At the very least this mapping can't be *I*G and *I** at the same time.
I agree the G bit shouldn't be set here.
Usually I and G go together...
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 15 lines
(quoted diff) +3
-0+#define CONFIG_SYS_RAMBOOT +#define CONFIG_RAMBOOT_PBL +#define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASEand
(quoted diff) +8
-0+/* + * Config the L3 Cache as L3 SRAM + */ +#define CONFIG_SYS_INIT_L3_ADDR CONFIG_RAMBOOT_TEXT_BASE +#define CONFIG_SYS_INIT_L3_ADDR_PHYS (0xf00000000ull | \ + CONFIG_RAMBOOT_TEXT_BASE) +#define CONFIG_SYS_L3_SIZE (1024 << 10) +#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR +Quoted 1 line
CONFIG_SYS_L3_SIZE)...and this doesn't cover the boot page.
Quoted 6 lines
Quoted 2 lines
Also, can you answer the question about why the L3 SRAM mapping is cache-inhibited?
I suspect this is the idea carried from early NAND boot implementation. You are mostly familiar with NAND and SPL boot, can you examine if we can turn on the cache for these cases?
NAND SPL on some targets is so space constrained that adding a few instructions to turn cache on might go over the limit. :-)
Are you talking about mapping the NAND buffer that we boot directly out of, or the L2SRAM that we sometimes load the SPL payload into? If the former, that is I+G because we proceed to use it for I/O after relocating out of it.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 42 lines · Scott Wood
Quoted 32 lines · York Sun
Quoted 31 lines · Scott Wood
Quoted 30 lines · Scott Wood
Quoted 29 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 21 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ /* TLB 1 */ + /* *I*** - Covers boot page */ + /* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the + * SRAM is at 0xfff00000, it covered the 0xfffff000. + */ + SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
I think this entry replaces the default TLB out of reset and it does cover the boot page 0xfffff000~0xffffffff.
Quoted 8 lines
That's not what the comment appears to say (unless you read the word "cover" in a non-intuitive and ambiguous way). These comments generally talk about what the new TLB is, not what is being replaced.
Quoted 1 line
It is not unique to this platform. You can find many similar existing code.
I know that. That's why I'm asking you to explain it rather than Valentin. :-)
We have many developers around the globe so people understand "cover" differently. I interpret the "cover" here as this TLB translates the address space which includes the boot page.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
At the very least this mapping can't be *I*G and *I** at the same time.
I agree the G bit shouldn't be set here.
Usually I and G go together...
The default TLB out of reset has I bit but not G bit. I have to admit that I don't remember when I used G bit intentionally.
Quoted 27 lines
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 16 lines
(quoted diff) +3
-0+#define CONFIG_SYS_RAMBOOT +#define CONFIG_RAMBOOT_PBL +#define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASEand
(quoted diff) +8
-0+/* + * Config the L3 Cache as L3 SRAM + */ +#define CONFIG_SYS_INIT_L3_ADDR CONFIG_RAMBOOT_TEXT_BASE +#define CONFIG_SYS_INIT_L3_ADDR_PHYS (0xf00000000ull | \ + CONFIG_RAMBOOT_TEXT_BASE) +#define CONFIG_SYS_L3_SIZE (1024 << 10) +#define CONFIG_SYS_INIT_L3_END (CONFIG_SYS_INIT_L3_ADDR +Quoted 1 line
CONFIG_SYS_L3_SIZE)...and this doesn't cover the boot page.
Quoted 6 lines
Quoted 2 lines
Also, can you answer the question about why the L3 SRAM mapping is cache-inhibited?
I suspect this is the idea carried from early NAND boot implementation. You are mostly familiar with NAND and SPL boot, can you examine if we can turn on the cache for these cases?
Quoted 7 lines
NAND SPL on some targets is so space constrained that adding a few instructions to turn cache on might go over the limit. :-)
Are you talking about mapping the NAND buffer that we boot directly out of, or the L2SRAM that we sometimes load the SPL payload into? If the former, that is I+G because we proceed to use it for I/O after relocating out of it.
I am talking aout the latter one. For SPL cases, the code is copied to some type of volatile memory and the core boots from there. I am not sure if we can turn on cache for all cases. Probably yes.
York
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 47 lines · York Sun
Quoted 46 lines · Scott Wood
Quoted 32 lines · York Sun
Quoted 31 lines · Scott Wood
Quoted 30 lines · Scott Wood
Quoted 29 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 21 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ /* TLB 1 */ + /* *I*** - Covers boot page */ + /* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the + * SRAM is at 0xfff00000, it covered the 0xfffff000. + */ + SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
I think this entry replaces the default TLB out of reset and it does cover the boot page 0xfffff000~0xffffffff.
That's not what the comment appears to say (unless you read the word "cover" in a non-intuitive and ambiguous way). These comments generally talk about what the new TLB is, not what is being replaced.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
It is not unique to this platform. You can find many similar existing code.
I know that. That's why I'm asking you to explain it rather than Valentin. :-)
We have many developers around the globe so people understand "cover" differently. I interpret the "cover" here as this TLB translates the address space which includes the boot page.
That's how I'd interpret it as well, but then the comment that "this entry replaces..." doesn't make sense.
This entry is for L3SRAM which is 1 MiB at 0xf00000000 which is nowhere near the boot page.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
At the very least this mapping can't be *I*G and *I** at the same time.
I agree the G bit shouldn't be set here.
Usually I and G go together...
The default TLB out of reset has I bit but not G bit.
That entry would have already been replaced by asm code.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 53 lines · Scott Wood
Quoted 52 lines · York Sun
Quoted 50 lines · Scott Wood
Quoted 32 lines · York Sun
Quoted 31 lines · Scott Wood
Quoted 30 lines · Scott Wood
Quoted 29 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 21 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ /* TLB 1 */ + /* *I*** - Covers boot page */ + /* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the + * SRAM is at 0xfff00000, it covered the 0xfffff000. + */ + SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
I think this entry replaces the default TLB out of reset and it does cover the boot page 0xfffff000~0xffffffff.
That's not what the comment appears to say (unless you read the word "cover" in a non-intuitive and ambiguous way). These comments generally talk about what the new TLB is, not what is being replaced.
Quoted 1 line
It is not unique to this platform. You can find many similar existing code.
I know that. That's why I'm asking you to explain it rather than Valentin. :-)
Quoted 6 lines
Quoted 3 lines
We have many developers around the globe so people understand "cover" differently. I interpret the "cover" here as this TLB translates the address space which includes the boot page.
That's how I'd interpret it as well, but then the comment that "this entry replaces..." doesn't make sense.
The default TLB is TLB1 entry 0. This is the same TLB. Along the booting process, we switch to AS=1 and replace the default TLB with this one, then switch back. That's why I said "replace". I am sure you are very familiar with this process.
Quoted 3 lines
This entry is for L3SRAM which is 1 MiB at
0xf00000000which is nowhere near the boot page.
It maps from CONFIG_SYS_INIT_L3_ADDR ( == CONFIG_RAMBOOT_TEXT_BASE == CONFIG_SYS_TEXT_BASE == 0xfff80000) to CONFIG_SYS_INIT_L3_ADDR_PHYS ( == 0xf00000000ull | CONFIG_RAMBOOT_TEXT_BASE).
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
At the very least this mapping can't be *I*G and *I** at the same time.
I agree the G bit shouldn't be set here.
Usually I and G go together...
The default TLB out of reset has I bit but not G bit.
That entry would have already been replaced by asm code.
No argument here. I was pointing out one case "I" and "G" don't go together.
York
RFC PATCH 1/1 powerpc/embedded6xx: Add support for Motorola/Emerson MVME5100.
Quoted 54 lines · York Sun
Quoted 53 lines · Scott Wood
Quoted 52 lines · York Sun
Quoted 50 lines · Scott Wood
Quoted 32 lines · York Sun
Quoted 31 lines · Scott Wood
Quoted 30 lines · Scott Wood
Quoted 29 lines · York Sun
Quoted 3 lines · Scott Wood
Quoted 2 lines · Valentin Longchamp
Quoted 1 line · Scott Wood
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
<snip>
Quoted 21 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ /* TLB 1 */ + /* *I*** - Covers boot page */ + /* *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the + * SRAM is at 0xfff00000, it covered the 0xfffff000. + */ + SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L3_ADDR, CONFIG_SYS_INIT_L3_ADDR, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_1M, 1),What does that "covers boot page" comment refer to?
Quoted 5 lines
Quoted 2 lines
Why is L3SRAM I+G?
I have taken this from the corenet
SYS_RAMBOOTboot scenario since it's also the way our board boots.York, can you answer this?
I suspect the "covers boot page" comment is left over from before the recent spin table changes.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Look at the context, this is used as SRAM with PBL boot method. Notice these macros in header file
I'm not talking about the SRAM comment, but the "covers boot page" comment before it.
I think this entry replaces the default TLB out of reset and it does cover the boot page 0xfffff000~0xffffffff.
That's not what the comment appears to say (unless you read the word "cover" in a non-intuitive and ambiguous way). These comments generally talk about what the new TLB is, not what is being replaced.
Quoted 1 line
It is not unique to this platform. You can find many similar existing code.
I know that. That's why I'm asking you to explain it rather than Valentin. :-)
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
We have many developers around the globe so people understand "cover" differently. I interpret the "cover" here as this TLB translates the address space which includes the boot page.
That's how I'd interpret it as well, but then the comment that "this entry replaces..." doesn't make sense.
The default TLB is TLB1 entry 0. This is the same TLB.
It's the same ESEL, but the entry itself should have been cleared by now (see "Clear out any other TLB entries..." in arch/powerpc/cpu/mpc85xx/start.S).
In any case, the entry that we're describing in the comments should be the new entry which does not cover the boot page. We're no longer using the boot page at this point (on the boot core).
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
In reply to Scott WoodQuoted 25 lines · Scott Wood
Quoted 24 lines · Valentin Longchamp
Quoted 22 lines · Scott Wood
Quoted 14 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 portQuoted 3 lines
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).
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Quoted 8 lines
Quoted 5 lines
Well, I had tried to come a first proposal that factored shared code but I was advised to copy the code: [1]. For the copyrights I will fix it.
[1]
Did you mean to cite something here?
Oops, yes sorry:
http://u-boot.10912.n7.nabble.com/RFC-PATCH-mpc85xx-move-generic-corenet-to-cpu-mpc85xxx-tt153910.html#none
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 29 lines · Valentin Longchamp
Quoted 28 lines · Scott Wood
Quoted 27 lines · Valentin Longchamp
Quoted 15 lines · Scott Wood
Quoted 14 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 portQuoted 7 lines
Quoted 3 lines
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).
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Well, I had tried to come a first proposal that factored shared code but I was advised to copy the code: [1]. For the copyrights I will fix it.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
[1]
Did you mean to cite something here?
Oops, yes sorry:
http://u-boot.10912.n7.nabble.com/RFC-PATCH-mpc85xx-move-generic-corenet-to-cpu-mpc85xxx-tt153910.html#none
I think the problem there was that you shared too much, not that sharing is bad in general.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 36 lines · Scott Wood
Quoted 35 lines · Valentin Longchamp
Quoted 33 lines · Scott Wood
Quoted 20 lines · Valentin Longchamp
Quoted 19 lines · Scott Wood
Quoted 17 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).
Quoted 9 lines
Quoted 3 lines
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Well, I had tried to come a first proposal that factored shared code but I was advised to copy the code: [1]. For the copyrights I will fix it.
[1]
Did you mean to cite something here?
Quoted 7 lines
Quoted 3 lines
Oops, yes sorry:
http://u-boot.10912.n7.nabble.com/RFC-PATCH-mpc85xx-move-generic-corenet-to-cpu-mpc85xxx-tt153910.html#noneI think the problem there was that you shared too much, not that sharing is bad in general.
OK, then could you please tell me more precisely what you would expect to be shared and not shared ? Because getting 2 contradictory feedbacks confuses me here.
Valentin
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 41 lines · Valentin Longchamp
Quoted 40 lines · Scott Wood
Quoted 38 lines · Valentin Longchamp
Quoted 25 lines · Scott Wood
Quoted 24 lines · Valentin Longchamp
Quoted 22 lines · Scott Wood
Quoted 14 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 portQuoted 3 lines
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).
A lot of the copied files have had Freescale copyrights removed... Also please try to factor shared code out rather than duplicate, where practical.
Quoted 8 lines
Quoted 5 lines
Well, I had tried to come a first proposal that factored shared code but I was advised to copy the code: [1]. For the copyrights I will fix it.
[1]
Did you mean to cite something here?
Oops, yes sorry:
http://u-boot.10912.n7.nabble.com/RFC-PATCH-mpc85xx-move-generic-corenet-to-cpu-mpc85xxx-tt153910.html#none
Quoted 6 lines
Quoted 3 lines
I think the problem there was that you shared too much, not that sharing is bad in general.
OK, then could you please tell me more precisely what you would expect to be shared and not shared ? Because getting 2 contradictory feedbacks confuses me here.
It's not contradictory. Andy said not to share PIXIS code (you don't have our FPGA on your board) and not to share LAW/TLB setup. I agree with that. There's other stuff that could be shared that isn't board-specific, such as the RCW printing code, probably parts of the DDR code, etc. The point is to evaluate things individually when copying them as to whether they should be shared instead, rather than either blindly copying or blindly sharing.
-Scott
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
In reply to Valentin LongchampQuoted 4 lines · Valentin Longchamp
board/keymile/kmp204x/ddr.c new file +4
-0+ +phys_size_t initdram (int board_type) +{ +phys_size_t dram_size =0 ;
board/keymile/kmp204x/ddr.c line 77
Quoted 10 lines
board/keymile/kmp204x/ddr.c new file +10
-0+ +puts ("Initializing...." ); + +if (fsl_use_spd ()) { +puts ("using SPD\n" ); + dram_size =fsl_ddr_sdram (); + }else { +puts ("no SPD and fixed parameters\n" ); +return dram_size; + }
How does the else clause work? You probably want to put an error or panic here if you don't have other way to initialize it.
York
PATCH 8/8 mpc85xx: introduce the kmp204x reference design support
Quoted 11 lines · York Sun
Quoted 10 lines · Valentin Longchamp
board/keymile/kmp204x/ddr.c new file +10
-0+ +phys_size_t initdram (int board_type) +{ +phys_size_t dram_size =0 ; + +puts ("Initializing...." ); + +if (fsl_use_spd ()) { +puts ("using SPD\n" ); + dram_size =fsl_ddr_sdram ();
Quoted 9 lines
board/keymile/kmp204x/ddr.c line 77
Quoted 4 lines
board/keymile/kmp204x/ddr.c new file +4
-0+ }else { +puts ("no SPD and fixed parameters\n" ); +return dram_size; + }How does the else clause work? You probably want to put an error or panic here if you don't have other way to initialize it.
OK I agree.
Valentin