Support for the kmp204x reference design
Subsystems (4)
v2 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 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):
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
KM: add CONFIG_KM_I2C_ABORT option
km: add CONFIG_KM_COMMON_ETH_INIT for km common eth init
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: introduce fsl_print_rcw function fsl/mpc85xx: define common serdes_clock_to_string function
mpc85xx: introduce the kmp204x reference design support
MAINTAINERS | 1 + arch/powerpc/cpu/mpc85xx/Makefile | 1 + arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 21 + arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c | 43 ++ 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/include/asm/fsl_ddr_dimm_params.h | 1 + arch/powerpc/include/asm/fsl_rcw.h | 19 + arch/powerpc/include/asm/fsl_serdes.h | 1 + board/freescale/b4860qds/b4860qds.c | 29 +- board/freescale/corenet_ds/corenet_ds.c | 38 +- board/freescale/p2041rdb/p2041rdb.c | 14 - board/freescale/t4qds/t4qds.c | 28 +- board/keymile/common/common.c | 8 +- board/keymile/kmp204x/Makefile | 48 +++ board/keymile/kmp204x/ddr.c | 80 ++++ board/keymile/kmp204x/eth.c | 87 ++++ board/keymile/kmp204x/kmp204x.c | 285 +++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 ++ board/keymile/kmp204x/law.c | 56 +++ board/keymile/kmp204x/pbi.cfg | 51 +++ board/keymile/kmp204x/pci.c | 51 +++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 126 ++++++ boards.cfg | 1 + drivers/mtd/nand/fsl_elbc_nand.c | 6 +- drivers/net/fm/init.c | 7 + include/configs/km/keymile-common.h | 4 +- include/configs/km/km-powerpc.h | 4 +- include/configs/km/km83xx-common.h | 4 + include/configs/km/km_arm.h | 2 + include/configs/km/kmp204x-common.h | 462 +++++++++++++++++++++ include/configs/km82xx.h | 2 + include/configs/kmp204x.h | 84 ++++ include/fm_eth.h | 1 + 38 files changed, 1534 insertions(+), 107 deletions(-) create mode 100644 arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c create mode 100644 arch/powerpc/include/asm/fsl_rcw.h 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 v2 1/11 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.
---
Changes in v2: None
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 v2 2/11 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.
---
Changes in v2: None
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 v2 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 v2: None
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 v2 4/11 KM: add CONFIG_KM_I2C_ABORT option
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. This patch defines them for both architectures.
The kmp204x and km83xx boards use other functions and thus do not define this.
---
Changes in v2:
- Introduce CONFIG_KM_I2C_ABORT #define to avoid #if !defined in common.c
board/keymile/common/common.c | 6 +----- include/configs/km/km_arm.h | 1 + include/configs/km82xx.h | 1 + 3 files changed, 3 insertions(+), 5 deletions(-)
board/keymile/common/common.c +1 -5
@@ -40,10 +40,6 @@#include "common.h" #include <i2c.h> -#if !defined(CONFIG_MPC83xx) -static void i2c_write_start_seq (void ); -#endif -DECLARE_GLOBAL_DATA_PTR ;/*
@@ -94,7 +90,7 @@ int set_km_env(void) } #if defined(CONFIG_SYS_I2C_INIT_BOARD) -#if !defined(CONFIG_MPC83xx) +#if defined(CONFIG_KM_I2C_ABORT) static void i2c_write_start_seq(void) { set_sda(1);
include/configs/km/km_arm.h +1 -0
@@ -59,6 +59,7 @@#define CONFIG_CMD_NAND #define CONFIG_CMD_SF #define CONFIG_SOFT_I2C /* I2C bit-banged */ +#define CONFIG_KM_I2C_ABORT /* SPI NOR Flash default params, used by sf commands */ #define CONFIG_SF_DEFAULT_SPEED 8100000
include/configs/km82xx.h +1 -0
@@ -247,6 +247,7 @@#define CONFIG_SOFT_I2C /* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 50000/* I2C speed */ #define CONFIG_SYS_I2C_SLAVE 0x7F/* I2C slave address */ +#define CONFIG_KM_I2C_ABORT /* * Software (bit-bang) I2C driver configuration
Signature · 1 line
1.8.0.1
PATCH v2 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 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
@@ -179,6 +179,7 @@ void i2c_init_board(void) }#endif +#if defined(CONFIG_KM_COMMON_ETH_INIT )int board_eth_init (bd_t *bis) {if (ethernet_present ())
@@ -186,6 +187,7 @@ int board_eth_init(bd_t *bis) return -1; } +#endif /* * do_setboardid command
include/configs/km/km-powerpc.h +3 -0
@@ -33,6 +33,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
@@ -179,6 +179,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
PATCH v2 6/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.
---
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
@@ -764,6 +764,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 */
@@ -781,6 +782,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)
@@ -1625,7 +1630,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
@@ -320,6 +320,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
@@ -77,6 +77,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
PATCH v2 6/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.
Signed-off-by Valentin Longchamp <[email protected]>---
Can you add a line in commit message about on which board, what model memory modules have been verified?
York
PATCH v2 7/11 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.
---
Changes in v2: None
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 v2 8/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 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
@@ -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 v2 9/11 fsl/mpc85xx: introduce fsl_print_rcw function
In reply to Valentin LongchampThe RCW gets printed on a lot of FSL 85xx devices and it is always done the same way.
The fsl_print_rcw function performs this exact same task.
---
Changes in v2: None
arch/powerpc/cpu/mpc85xx/Makefile | 1 + arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c | 43 ++++++++++++++++++++++++++++++ arch/powerpc/include/asm/fsl_rcw.h | 19 +++++++++++++ board/freescale/b4860qds/b4860qds.c | 13 ++------- board/freescale/corenet_ds/corenet_ds.c | 24 +++++++---------- board/freescale/t4qds/t4qds.c | 12 ++------- 6 files changed, 76 insertions(+), 36 deletions(-) create mode 100644 arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c create mode 100644 arch/powerpc/include/asm/fsl_rcw.h
arch/powerpc/cpu/mpc85xx/Makefile +1 -0
@@ -114,6 +114,7 @@ COBJS-$(CONFIG_QE) += qe_io.o COBJS-$(CONFIG_CPM2) += serial_scc.o COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS1) += fsl_corenet_serdes.o COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS2) += fsl_corenet2_serdes.o +COBJS-$(CONFIG_FSL_CORENET) += fsl_corenet_rcw.o # SoC specific SERDES support COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o
arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c new file +43 -0
43 lines not on this page · raw message
arch/powerpc/include/asm/fsl_rcw.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* (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. +*/ + +#ifndef __ASM_PPC_FSL_RCW_H +#define __ASM_PPC_FSL_RCW_H + +void fsl_print_rcw (void ); + +#endif /* __ASM_PPC_FSL_RCW_H */
board/freescale/b4860qds/b4860qds.c +2 -11
@@ -33,6 +33,7 @@#include <asm/fsl_serdes.h> #include <asm/fsl_portals.h> #include <asm/fsl_liodn.h> +#include <asm/fsl_rcw.h> #include <fm_eth.h> #include "../common/qixis.h"
@@ -51,8 +52,6 @@ int checkboard(void)char buf[64 ];u8 sw;struct cpu_type *cpu = gd->arch.cpu; -ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; -unsigned int i;static const char *const freq[] = {"100" ,"125" ,"156.25" ,"161.13" ,"122.88" ,"122.88" ,"122.88" };int clock;
@@ -80,15 +79,7 @@ int checkboard(void)/* Display the RCW, so that no one gets confused as to what RCW * we're actually using for this boot. */ -puts ("Reset Configuration Word (RCW):" ); -for (i =0 ; i <ARRAY_SIZE (gur->rcwsr); i++) { -u32 rcw =in_be32 (&gur->rcwsr[i]); - -if ((i %4 ) ==0 ) -printf ("\n %08x:" , i *4 ); -printf (" %08x" , rcw); - } -puts ("\n" ); +fsl_print_rcw ();/* * Display the actual SERDES reference clocks as configured by the
board/freescale/corenet_ds/corenet_ds.c +9 -15
@@ -32,6 +32,7 @@#include <asm/fsl_serdes.h> #include <asm/fsl_portals.h> #include <asm/fsl_liodn.h> +#include <asm/fsl_rcw.h> #include <fm_eth.h> #include "../common/ngpixis.h"
@@ -43,8 +44,6 @@ int checkboard (void) {u8 sw;struct cpu_type *cpu = gd->arch.cpu; -ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; -unsigned int i;static const char *const freq[] = {"100" ,"125" ,"156.25" ,"212.5" };printf ("Board: %sDS, " , cpu->name);
@@ -66,15 +65,7 @@ int checkboard (void)/* Display the RCW, so that no one gets confused as to what RCW * we're actually using for this boot. */ -puts ("Reset Configuration Word (RCW):" ); -for (i =0 ; i <ARRAY_SIZE (gur->rcwsr); i++) { -u32 rcw =in_be32 (&gur->rcwsr[i]); - -if ((i %4 ) ==0 ) -printf ("\n %08x:" , i *4 ); -printf (" %08x" , rcw); - } -puts ("\n" ); +fsl_print_rcw ();/* Display the actual SERDES reference clocks as configured by the * dip switches on the board. Note that the SWx registers could
@@ -86,11 +77,14 @@ int checkboard (void)puts ("SERDES Reference Clocks: " );#if defined(CONFIG_P3041DS ) || defined(CONFIG_P5020DS ) \ || defined(CONFIG_P5040DS ) - sw =in_8 (&PIXIS_SW (5 )); -for (i =0 ; i <3 ; i++) { -unsigned int clock = (sw >> (6 - (2 * i))) &3 ; + { +unsigned int i; + sw =in_8 (&PIXIS_SW (5 )); +for (i =0 ; i <3 ; i++) { +unsigned int clock = (sw >> (6 - (2 * i))) &3 ; -printf ("Bank%u=%sMhz " , i+1 , freq[clock]); +printf ("Bank%u=%sMhz " , i+1 , freq[clock]); + } }#ifdef CONFIG_P5040DS /* On P5040DS, SW11[7:8] determines the Bank 4 frequency */
board/freescale/t4qds/t4qds.c +2 -10
@@ -33,6 +33,7 @@#include <asm/fsl_serdes.h> #include <asm/fsl_portals.h> #include <asm/fsl_liodn.h> +#include <asm/fsl_rcw.h> #include <fm_eth.h> #include "../common/qixis.h"
@@ -59,7 +60,6 @@ int checkboard(void)char buf[64 ];u8 sw;struct cpu_type *cpu = gd->arch.cpu; -ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;unsigned int i;printf ("Board: %sQDS, " , cpu->name);
@@ -87,15 +87,7 @@ int checkboard(void)/* Display the RCW, so that no one gets confused as to what RCW * we're actually using for this boot. */ -puts ("Reset Configuration Word (RCW):" ); -for (i =0 ; i <ARRAY_SIZE (gur->rcwsr); i++) { -u32 rcw =in_be32 (&gur->rcwsr[i]); - -if ((i %4 ) ==0 ) -printf ("\n %08x:" , i *4 ); -printf (" %08x" , rcw); - } -puts ("\n" ); +fsl_print_rcw ();/* * Display the actual SERDES reference clocks as configured by the
Signature · 1 line
1.8.0.1
PATCH v2 9/11 fsl/mpc85xx: introduce fsl_print_rcw function
Quoted 51 lines · Valentin Longchamp
The RCW gets printed on a lot of FSL 85xx devices and it is always done the same way.
The
fsl_print_rcwfunction performs this exact same task.Signed-off-by Valentin Longchamp <[email protected]>---
Changes in v2: Nonearch/powerpc/cpu/mpc85xx/Makefile | 1 + arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c | 43 ++++++++++++++++++++++++++++++ arch/powerpc/include/asm/fsl_rcw.h | 19 +++++++++++++ board/freescale/b4860qds/b4860qds.c | 13 ++------- board/freescale/corenet_ds/corenet_ds.c | 24 +++++++---------- board/freescale/t4qds/t4qds.c | 12 ++------- 6 files changed, 76 insertions(+), 36 deletions(-) create mode 100644 arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c create mode 100644 arch/powerpc/include/asm/fsl_rcw.harch/powerpc/cpu/mpc85xx/Makefile +1
-0@@ -114,6 +114,7 @@ COBJS-$(CONFIG_QE) += qe_io.o COBJS-$(CONFIG_CPM2) += serial_scc.o COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS1) += fsl_corenet_serdes.o COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS2) += fsl_corenet2_serdes.o +COBJS-$(CONFIG_FSL_CORENET) += fsl_corenet_rcw.o # SoC specific SERDES support COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.oarch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c new file +13
-0@@ -0,0 +1,43 @@ +/* +* (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,
arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c line 23
Quoted 10 lines
arch/powerpc/cpu/mpc85xx/fsl_corenet_rcw.c new file +10
-0+* 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 +*/ +
Please retain original copyright when you move partial code to a new file. Also please use the new license string.
Also apply to other part of this patch.
York
PATCH v2 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 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/t4qds.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
@@ -874,3 +874,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
@@ -99,6 +99,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
@@ -367,22 +367,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
@@ -148,20 +148,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
@@ -186,20 +186,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/t4qds.c +0 -16
@@ -595,22 +595,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
PATCH v2 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.
---
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
MAINTAINERS | 1 + board/keymile/kmp204x/Makefile | 48 ++++ board/keymile/kmp204x/ddr.c | 80 ++++++ board/keymile/kmp204x/eth.c | 87 +++++++ board/keymile/kmp204x/kmp204x.c | 285 +++++++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 +++ board/keymile/kmp204x/law.c | 56 +++++ board/keymile/kmp204x/pbi.cfg | 51 ++++ board/keymile/kmp204x/pci.c | 51 ++++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 126 ++++++++++ boards.cfg | 1 + include/configs/km/kmp204x-common.h | 462 ++++++++++++++++++++++++++++++++++ include/configs/kmp204x.h | 84 +++++++ 14 files changed, 1374 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
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/kmp204x/Makefile new file +48 -0
48 lines not on this page · raw message
board/keymile/kmp204x/ddr.c new file +80 -0
80 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 +285 -0
285 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 +56 -0
56 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 +51 -0
51 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 +126 -0
126 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 v2 11/11 mpc85xx: introduce the kmp204x reference design support
Quoted 23 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]>
Quoted 10 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
Please use the new license header string.
York
PATCH v2 11/11 mpc85xx: introduce the kmp204x reference design support
In reply to Valentin LongchampQuoted 65 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]>---
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 feedbackMAINTAINERS | 1 + board/keymile/kmp204x/Makefile | 48 ++++ board/keymile/kmp204x/ddr.c | 80 ++++++ board/keymile/kmp204x/eth.c | 87 +++++++ board/keymile/kmp204x/kmp204x.c | 285 +++++++++++++++++++++ board/keymile/kmp204x/kmp204x.h | 31 +++ board/keymile/kmp204x/law.c | 56 +++++ board/keymile/kmp204x/pbi.cfg | 51 ++++ board/keymile/kmp204x/pci.c | 51 ++++ board/keymile/kmp204x/rcw_kmp204x.cfg | 11 + board/keymile/kmp204x/tlb.c | 126 ++++++++++ boards.cfg | 1 + include/configs/km/kmp204x-common.h | 462 ++++++++++++++++++++++++++++++++++ include/configs/kmp204x.h | 84 +++++++ 14 files changed, 1374 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.hMAINTAINERS +0
-0
MAINTAINERS Valentin Longchamp <[email protected]> · line 782
Quoted 5 lines
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)
Do you mean "kmlion1" instead of "kmcoge4" here? See below boards.cfg file.
<snip>
boards.cfg tuge1 powerpc mpc83xx km83xx keymile · line 750
Quoted 10 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: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
No need to resend this patch. I need to fix it for the new boards.cfg format anyway. Just need your confirmation.
York