add LS1043A platform support
Subsystems (9)
v8 cover add LS1043A platform support
Hi all,
Here are the changes for V8 patchset. Please help to review them.
- Update the patch based on the latest U-Boot code.
- Remove "net/fm/eth: Use mb() to be compatible for both ARM"
[Patch V8 01/17] common/board_f.c: change the macro name and remove [Patch V8 02/17] armv7/ls1021a: move ns_access to common file [Patch V8 03/17] net/fm: Fix the endian issue to support both [Patch V8 04/17] net/fm: Add support for 64-bit platforms [Patch V8 05/17] net/fm: Make the return value logic consistent with [Patch V8 06/17] net: fm: bug fix when CONFIG_PHYLIB not defined [Patch V8 07/17] net: Move some header files to include/ [Patch V8 08/17] net/fm: Add QSGMII PCS init
[Patch V8 09/17] net/fm: fix MDIO controller base on FMAN2 [Patch V8 10/17] armv8/fsl_lsch3: Change arch to fsl-layerscape [Patch V8 11/17] armv8/fsl_lsch2: Add fsl_lsch2 SoC [Patch V8 12/17] armv8/ls1043ardb: Add LS1043ARDB board support [Patch V8 13/17] armv8/ls1043ardb: Add nand boot support [Patch V8 14/17] armv8/ls1043a: Add Fman support
[Patch V8 15/17] armv8/ls1043ardb: esdhc: Add esdhc support for [Patch V8 16/17] armv8/ls1043ardb: Add sd boot support [Patch V8 17/17] armv8/ls1043a: Enable secondary cores
PATCH v8 1/17 common/board_f.c: change the macro name and remove it for PPC platforms
For most PPC platforms, they will call the first get_clocks() in init_sequence_f[] as they define CONFIG_PPC. CONFIG_SYS_FSL_CLK is then defined to call the second get_clocks(), which should be redundant for PPC.
---
V8:
- New patch. Base on latest U-Boot code.
common/board_f.c | 2 +- doc/README.fsl-clk | 6 ++++++ include/configs/BSC9132QDS.h | 1 - include/configs/MPC8308RDB.h | 1 - include/configs/MPC837XEMDS.h | 1 - include/configs/MPC837XERDB.h | 1 - include/configs/MPC8536DS.h | 1 - include/configs/MPC8569MDS.h | 1 - include/configs/P1010RDB.h | 1 - include/configs/P1022DS.h | 1 - include/configs/P2041RDB.h | 1 - include/configs/T102xQDS.h | 1 - include/configs/T102xRDB.h | 1 - include/configs/T1040QDS.h | 1 - include/configs/T104xRDB.h | 1 - include/configs/T208xQDS.h | 1 - include/configs/T208xRDB.h | 1 - include/configs/T4240QDS.h | 1 - include/configs/T4240RDB.h | 1 - include/configs/UCP1020.h | 1 - include/configs/colibri_vf.h | 2 +- include/configs/controlcenterd.h | 1 - include/configs/corenet_ds.h | 1 - include/configs/hrcon.h | 1 - include/configs/ls1021aqds.h | 2 +- include/configs/ls1021atwr.h | 2 +- include/configs/ls2085aqds.h | 2 +- include/configs/ls2085ardb.h | 2 +- include/configs/m53evk.h | 2 +- include/configs/mx25pdk.h | 2 +- include/configs/mx35pdk.h | 2 +- include/configs/mx51evk.h | 2 +- include/configs/mx53ard.h | 2 +- include/configs/mx53evk.h | 2 +- include/configs/mx53loco.h | 2 +- include/configs/mx53smd.h | 2 +- include/configs/mx6_common.h | 2 +- include/configs/mx7_common.h | 1 + include/configs/p1_p2_rdb_pc.h | 1 - include/configs/p1_twr.h | 1 - include/configs/usbarmory.h | 2 +- include/configs/vf610twr.h | 2 +- include/configs/woodburn_common.h | 2 +- 43 files changed, 25 insertions(+), 41 deletions(-)
common/board_f.c +1 -1
@@ -806,7 +806,7 @@ static init_fnc_t init_sequence_f[] = {#if defined(CONFIG_BOARD_POSTCLK_INIT ) board_postclk_init,#endif -#ifdef CONFIG_FSL_CLK +#ifdef CONFIG_SYS_FSL_CLK get_clocks,#endif #ifdef CONFIG_M68K
doc/README.fsl-clk new file +6 -0
@@ -0,0 +1,6 @@ +Freescale system clock options + + - CONFIG_SYS_FSL_CLK + Enable to call get_clocks() in board_init_f() for + non-PPC platforms and PCC 8xx platforms such as + TQM866M and TQM885D.
include/configs/BSC9132QDS.h +0 -1
@@ -17,7 +17,6 @@#define CONFIG_BSC9132 #endif -#define CONFIG_FSL_CLK #define CONFIG_MISC_INIT_R #ifdef CONFIG_SDCARD
include/configs/MPC8308RDB.h +0 -1
@@ -10,7 +10,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK /* * High Level Configuration Options
include/configs/MPC837XEMDS.h +0 -1
@@ -9,7 +9,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK /* * High Level Configuration Options
include/configs/MPC837XERDB.h +0 -1
@@ -16,7 +16,6 @@#define CONFIG_MPC837x 1/* MPC837x CPU specific */ #define CONFIG_MPC837XERDB 1#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #define CONFIG_SYS_TEXT_BASE 0xFE000000
include/configs/MPC8536DS.h +0 -1
@@ -12,7 +12,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #include "../board/freescale/common/ics307_clk.h" #ifdef CONFIG_36BIT
include/configs/MPC8569MDS.h +0 -1
@@ -12,7 +12,6 @@#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK /* High Level Configuration Options */ #define CONFIG_BOOKE 1/* BOOKE */ #define CONFIG_E500 1/* BOOKE e500 family */
include/configs/P1010RDB.h +0 -1
@@ -15,7 +15,6 @@#define CONFIG_PHYS_64BIT #endif #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #define CONFIG_P1010 #define CONFIG_E500 /* BOOKE e500 family */
include/configs/P1022DS.h +0 -1
@@ -12,7 +12,6 @@#include "../board/freescale/common/ics307_clk.h" #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #ifdef CONFIG_36BIT #define CONFIG_PHYS_64BIT
include/configs/P2041RDB.h +0 -1
@@ -15,7 +15,6 @@#define CONFIG_PHYS_64BIT #define CONFIG_DISPLAY_BOARDINFO #define CONFIG_PPC_P2041 -#define CONFIG_FSL_CLK #ifdef CONFIG_RAMBOOT_PBL #define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASE
include/configs/T102xQDS.h +0 -1
@@ -20,7 +20,6 @@#define CONFIG_MP /* support multiple processors */ #define CONFIG_PHYS_64BIT #define CONFIG_ENABLE_36BIT_PHYS -#define CONFIG_FSL_CLK #ifdef CONFIG_PHYS_64BIT #define CONFIG_ADDR_MAP 1
include/configs/T102xRDB.h +0 -1
@@ -20,7 +20,6 @@#define CONFIG_MP /* support multiple processors */ #define CONFIG_PHYS_64BIT #define CONFIG_ENABLE_36BIT_PHYS -#define CONFIG_FSL_CLK #ifdef CONFIG_PHYS_64BIT #define CONFIG_ADDR_MAP 1
include/configs/T1040QDS.h +0 -1
@@ -29,7 +29,6 @@#define CONFIG_T1040QDS #define CONFIG_PHYS_64BIT #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #ifdef CONFIG_RAMBOOT_PBL #define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASE
include/configs/T104xRDB.h +0 -1
@@ -13,7 +13,6 @@#define CONFIG_T104xRDB#define CONFIG_PHYS_64BIT #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #define CONFIG_E500 /* BOOKE e500 family */ #include <asm/config_mpc85xx.h>
include/configs/T208xQDS.h +0 -1
@@ -13,7 +13,6 @@#define CONFIG_DISPLAY_BOARDINFO #define CONFIG_ICS307_REFCLK_HZ 25000000/* ICS307 ref clk freq */ -#define CONFIG_FSL_CLK #define CONFIG_MMC #define CONFIG_USB_EHCI #if defined(CONFIG_PPC_T2080 )
include/configs/T208xRDB.h +0 -1
@@ -14,7 +14,6 @@#define CONFIG_DISPLAY_BOARDINFO #define CONFIG_T2080RDB #define CONFIG_ICS307_REFCLK_HZ 25000000/* ICS307 ref clk freq */ -#define CONFIG_FSL_CLK #define CONFIG_MMC #define CONFIG_USB_EHCI #define CONFIG_FSL_SATA_V2
include/configs/T4240QDS.h +0 -1
@@ -12,7 +12,6 @@#define CONFIG_T4240QDS #define CONFIG_PHYS_64BIT -#define CONFIG_FSL_CLK #define CONFIG_FSL_SATA_V2 #define CONFIG_PCIE4
include/configs/T4240RDB.h +0 -1
@@ -13,7 +13,6 @@#define CONFIG_T4240RDB #define CONFIG_PHYS_64BIT #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #define CONFIG_FSL_SATA_V2 #define CONFIG_PCIE4
include/configs/UCP1020.h +0 -1
@@ -15,7 +15,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #define CONFIG_FSL_ELBC #define CONFIG_PCI
include/configs/colibri_vf.h +1 -1
@@ -18,7 +18,7 @@#define CONFIG_SYS_THUMB_BUILD #define CONFIG_USE_ARCH_MEMCPY #define CONFIG_USE_ARCH_MEMSET -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_ARCH_MISC_INIT #define CONFIG_DISPLAY_CPUINFO
include/configs/controlcenterd.h +0 -1
@@ -44,7 +44,6 @@#define CONFIG_P1022 #define CONFIG_CONTROLCENTERD #define CONFIG_MP /* support multiple processors */ -#define CONFIG_FSL_CLK #define CONFIG_SYS_NO_FLASH
include/configs/corenet_ds.h +0 -1
@@ -11,7 +11,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #include "../board/freescale/common/ics307_clk.h"
include/configs/hrcon.h +0 -1
@@ -23,7 +23,6 @@#define CONFIG_IDENT_STRING " hrcon 0.01" -#define CONFIG_FSL_CLK #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_EARLY_INIT_R #define CONFIG_LAST_STAGE_INIT
include/configs/ls1021aqds.h +1 -1
@@ -11,7 +11,7 @@#define CONFIG_ARMV7_PSCI -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO
include/configs/ls1021atwr.h +1 -1
@@ -11,7 +11,7 @@#define CONFIG_ARMV7_PSCI -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO
include/configs/ls2085aqds.h +1 -1
@@ -16,7 +16,7 @@ unsigned long get_board_sys_clk(void);unsigned long get_board_ddr_clk (void );#endif -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_SYS_CLK_FREQ get_board_sys_clk()#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk()#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4)
include/configs/ls2085ardb.h +1 -1
@@ -18,7 +18,7 @@unsigned long get_board_sys_clk (void );#endif -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_SYS_CLK_FREQ get_board_sys_clk()#define CONFIG_DDR_CLK_FREQ 133333333#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4)
include/configs/m53evk.h +1 -1
@@ -17,7 +17,7 @@#define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_REVISION_TAG #define CONFIG_SYS_NO_FLASH -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_FIT
include/configs/mx25pdk.h +1 -1
@@ -14,7 +14,7 @@#define CONFIG_MX25 #define CONFIG_SYS_TEXT_BASE 0x81200000#define CONFIG_MXC_GPIO -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_SYS_TIMER_RATE 32768#define CONFIG_SYS_TIMER_COUNTER \
include/configs/mx35pdk.h +1 -1
@@ -19,7 +19,7 @@#define CONFIG_MX35 #define CONFIG_DISPLAY_CPUINFO -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK /* Set TEXT at the beginning of the NOR flash */ #define CONFIG_SYS_TEXT_BASE 0xA0000000
include/configs/mx51evk.h +1 -1
@@ -18,7 +18,7 @@#define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_SYS_TEXT_BASE 0x97800000#include <asm/arch/imx-regs.h>
include/configs/mx53ard.h +1 -1
@@ -23,7 +23,7 @@#define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
include/configs/mx53evk.h +1 -1
@@ -23,7 +23,7 @@#define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_OF_LIBFDT
include/configs/mx53loco.h +1 -1
@@ -22,7 +22,7 @@#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
include/configs/mx53smd.h +1 -1
@@ -23,7 +23,7 @@#define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
include/configs/mx6_common.h +1 -1
@@ -45,7 +45,7 @@#define CONFIG_DISPLAY_BOARDINFO #define CONFIG_DISPLAY_CPUINFO -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK /* ATAGs */ #define CONFIG_CMDLINE_TAG
include/configs/mx7_common.h +1 -0
@@ -21,6 +21,7 @@#define CONFIG_MXC_GPT_HCLK #define CONFIG_SYSCOUNTER_TIMER #define CONFIG_SC_TIMER_CLK 8000000/* 8Mhz */ +#define CONFIG_SYS_FSL_CLK /* Enable iomux-lpsr support */ #define CONFIG_IOMUX_LPSR
include/configs/p1_p2_rdb_pc.h +0 -1
@@ -11,7 +11,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #ifdef CONFIG_36BIT #define CONFIG_PHYS_64BIT
include/configs/p1_twr.h +0 -1
@@ -11,7 +11,6 @@#define __CONFIG_H#define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK #if defined(CONFIG_TWR_P1025 )#define CONFIG_BOARDNAME "TWR-P1025"#define CONFIG_P1025
include/configs/usbarmory.h +1 -1
@@ -14,7 +14,7 @@#define CONFIG_MX53 #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_OF_LIBFDT #define CONFIG_MXC_GPIO
include/configs/vf610twr.h +1 -1
@@ -15,7 +15,7 @@#define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_MACH_TYPE 4146
include/configs/woodburn_common.h +1 -1
@@ -16,7 +16,7 @@/* High Level Configuration Options */ #define CONFIG_MX35 #define CONFIG_MX35_HCLK_FREQ 24000000 -#define CONFIG_FSL_CLK +#define CONFIG_SYS_FSL_CLK #define CONFIG_SYS_DCACHE_OFF #define CONFIG_SYS_CACHELINE_SIZE 32
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 2/17 armv7/ls1021a: move ns_access to common file
In reply to Gong QianyuFrom: Mingkai Hu <[email protected]>
Config Security Level Register is different between different SoCs, so put the CSL register definition into the arch specific directory.
---
V8:
- No changes.
V7:
- Fix the macro for ls1021atwr.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- No change.
V2:
- Create include/fsl_csu.h instead of board/freescale/common/ns_access.h
arch/arm/include/asm/arch-ls102xa/ns_access.h | 103 ++++++++++++++++++++------ board/freescale/common/Makefile | 2 +- board/freescale/common/ns_access.c | 8 +- board/freescale/ls1021aqds/ls1021aqds.c | 101 ++----------------------- board/freescale/ls1021atwr/ls1021atwr.c | 102 ++----------------------- include/configs/ls1021aqds.h | 2 +- include/configs/ls1021atwr.h | 2 +- include/fsl_csu.h | 34 +++++++++ 8 files changed, 141 insertions(+), 213 deletions(-)
arch/arm/include/asm/arch-ls102xa/ns_access.h +82 -21
@@ -7,22 +7,6 @@#ifndef __FSL_NS_ACCESS_H_#define __FSL_NS_ACCESS_H_ -enum csu_cslx_access { -CSU_NS_SUP_R =0x08 , -CSU_NS_SUP_W =0x80 , -CSU_NS_SUP_RW =0x88 , -CSU_NS_USER_R =0x04 , -CSU_NS_USER_W =0x40 , -CSU_NS_USER_RW =0x44 , -CSU_S_SUP_R =0x02 , -CSU_S_SUP_W =0x20 , -CSU_S_SUP_RW =0x22 , -CSU_S_USER_R =0x01 , -CSU_S_USER_W =0x10 , -CSU_S_USER_RW =0x11 , -CSU_ALL_RW =0xff , -}; -enum csu_cslx_ind {CSU_CSLX_PCIE2_IO =0 , CSU_CSLX_PCIE1_IO,
@@ -108,11 +92,88 @@ enum csu_cslx_ind { CSU_CSLX_MAX, }; -struct csu_ns_dev { -unsigned long ind; -uint32_t val; +static struct csu_ns_dev ns_dev[] = { + {CSU_CSLX_PCIE2_IO ,CSU_ALL_RW }, + {CSU_CSLX_PCIE1_IO ,CSU_ALL_RW }, + {CSU_CSLX_MG2TPR_IP ,CSU_ALL_RW }, + {CSU_CSLX_IFC_MEM ,CSU_ALL_RW }, + {CSU_CSLX_OCRAM ,CSU_ALL_RW }, + {CSU_CSLX_GIC ,CSU_ALL_RW }, + {CSU_CSLX_PCIE1 ,CSU_ALL_RW }, + {CSU_CSLX_OCRAM2 ,CSU_ALL_RW }, + {CSU_CSLX_QSPI_MEM ,CSU_ALL_RW }, + {CSU_CSLX_PCIE2 ,CSU_ALL_RW }, + {CSU_CSLX_SATA ,CSU_ALL_RW }, + {CSU_CSLX_USB3 ,CSU_ALL_RW }, + {CSU_CSLX_SERDES ,CSU_ALL_RW }, + {CSU_CSLX_QDMA ,CSU_ALL_RW }, + {CSU_CSLX_LPUART2 ,CSU_ALL_RW }, + {CSU_CSLX_LPUART1 ,CSU_ALL_RW }, + {CSU_CSLX_LPUART4 ,CSU_ALL_RW }, + {CSU_CSLX_LPUART3 ,CSU_ALL_RW }, + {CSU_CSLX_LPUART6 ,CSU_ALL_RW }, + {CSU_CSLX_LPUART5 ,CSU_ALL_RW }, + {CSU_CSLX_DSPI2 ,CSU_ALL_RW }, + {CSU_CSLX_DSPI1 ,CSU_ALL_RW }, + {CSU_CSLX_QSPI ,CSU_ALL_RW }, + {CSU_CSLX_ESDHC ,CSU_ALL_RW }, + {CSU_CSLX_2D_ACE ,CSU_ALL_RW }, + {CSU_CSLX_IFC ,CSU_ALL_RW }, + {CSU_CSLX_I2C1 ,CSU_ALL_RW }, + {CSU_CSLX_USB2 ,CSU_ALL_RW }, + {CSU_CSLX_I2C3 ,CSU_ALL_RW }, + {CSU_CSLX_I2C2 ,CSU_ALL_RW }, + {CSU_CSLX_DUART2 ,CSU_ALL_RW }, + {CSU_CSLX_DUART1 ,CSU_ALL_RW }, + {CSU_CSLX_WDT2 ,CSU_ALL_RW }, + {CSU_CSLX_WDT1 ,CSU_ALL_RW }, + {CSU_CSLX_EDMA ,CSU_ALL_RW }, + {CSU_CSLX_SYS_CNT ,CSU_ALL_RW }, + {CSU_CSLX_DMA_MUX2 ,CSU_ALL_RW }, + {CSU_CSLX_DMA_MUX1 ,CSU_ALL_RW }, + {CSU_CSLX_DDR ,CSU_ALL_RW }, + {CSU_CSLX_QUICC ,CSU_ALL_RW }, + {CSU_CSLX_DCFG_CCU_RCPM ,CSU_ALL_RW }, + {CSU_CSLX_SECURE_BOOTROM ,CSU_ALL_RW }, + {CSU_CSLX_SFP ,CSU_ALL_RW }, + {CSU_CSLX_TMU ,CSU_ALL_RW }, + {CSU_CSLX_SECURE_MONITOR ,CSU_ALL_RW }, + {CSU_CSLX_RESERVED0 ,CSU_ALL_RW }, + {CSU_CSLX_ETSEC1 ,CSU_ALL_RW }, + {CSU_CSLX_SEC5_5 ,CSU_ALL_RW }, + {CSU_CSLX_ETSEC3 ,CSU_ALL_RW }, + {CSU_CSLX_ETSEC2 ,CSU_ALL_RW }, + {CSU_CSLX_GPIO2 ,CSU_ALL_RW }, + {CSU_CSLX_GPIO1 ,CSU_ALL_RW }, + {CSU_CSLX_GPIO4 ,CSU_ALL_RW }, + {CSU_CSLX_GPIO3 ,CSU_ALL_RW }, + {CSU_CSLX_PLATFORM_CONT ,CSU_ALL_RW }, + {CSU_CSLX_CSU ,CSU_ALL_RW }, + {CSU_CSLX_ASRC ,CSU_ALL_RW }, + {CSU_CSLX_SPDIF ,CSU_ALL_RW }, + {CSU_CSLX_FLEXCAN2 ,CSU_ALL_RW }, + {CSU_CSLX_FLEXCAN1 ,CSU_ALL_RW }, + {CSU_CSLX_FLEXCAN4 ,CSU_ALL_RW }, + {CSU_CSLX_FLEXCAN3 ,CSU_ALL_RW }, + {CSU_CSLX_SAI2 ,CSU_ALL_RW }, + {CSU_CSLX_SAI1 ,CSU_ALL_RW }, + {CSU_CSLX_SAI4 ,CSU_ALL_RW }, + {CSU_CSLX_SAI3 ,CSU_ALL_RW }, + {CSU_CSLX_FTM2 ,CSU_ALL_RW }, + {CSU_CSLX_FTM1 ,CSU_ALL_RW }, + {CSU_CSLX_FTM4 ,CSU_ALL_RW }, + {CSU_CSLX_FTM3 ,CSU_ALL_RW }, + {CSU_CSLX_FTM6 ,CSU_ALL_RW }, + {CSU_CSLX_FTM5 ,CSU_ALL_RW }, + {CSU_CSLX_FTM8 ,CSU_ALL_RW }, + {CSU_CSLX_FTM7 ,CSU_ALL_RW }, + {CSU_CSLX_COP_DCSR ,CSU_ALL_RW }, + {CSU_CSLX_EPU ,CSU_ALL_RW }, + {CSU_CSLX_GDI ,CSU_ALL_RW }, + {CSU_CSLX_DDI ,CSU_ALL_RW }, + {CSU_CSLX_RESERVED1 ,CSU_ALL_RW }, + {CSU_CSLX_USB3_PHY ,CSU_ALL_RW }, + {CSU_CSLX_RESERVED2 ,CSU_ALL_RW }, }; -void enable_devices_ns_access (struct csu_ns_dev *ns_dev,uint32_t num); -#endif
board/freescale/common/Makefile +1 -1
@@ -71,7 +71,7 @@ obj-$(CONFIG_P4080DS) += p_corenet/ obj-$(CONFIG_P5020DS) += p_corenet/ obj-$(CONFIG_P5040DS) += p_corenet/ -obj-$(CONFIG_LS102XA_NS_ACCESS) += ns_access.o +obj-$(CONFIG_LAYERSCAPE_NS_ACCESS) += ns_access.o ifdef CONFIG_SECURE_BOOT obj-$(CONFIG_CMD_ESBC_VALIDATE) += fsl_validate.o cmd_esbc_validate.o
board/freescale/common/ns_access.c +7 -1
@@ -6,9 +6,10 @@#include <common.h> #include <asm/io.h> +#include <fsl_csu.h> #include <asm/arch/ns_access.h> -void enable_devices_ns_access (struct csu_ns_dev *ns_dev,uint32_t num) +static void enable_devices_ns_access (struct csu_ns_dev *ns_dev,uint32_t num) {u32 *base = (u32 *)CONFIG_SYS_FSL_CSU_ADDR ;u32 *reg;
@@ -28,3 +29,8 @@ void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num)out_be32 (reg, val); } } + +void enable_layerscape_ns_access (void ) +{ +enable_devices_ns_access (ns_dev,ARRAY_SIZE (ns_dev)); +}
board/freescale/ls1021aqds/ls1021aqds.c +7 -94
137 lines not on this page · raw message
board/freescale/ls1021atwr/ls1021atwr.c +8 -94
138 lines not on this page · raw message
include/configs/ls1021aqds.h +1 -1
@@ -563,7 +563,7 @@ unsigned long get_board_ddr_clk(void);#define CONFIG_ARMV7_NONSEC #define CONFIG_ARMV7_VIRT #define CONFIG_PEN_ADDR_BIG_ENDIAN -#define CONFIG_LS102XA_NS_ACCESS +#define CONFIG_LAYERSCAPE_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200#define CONFIG_TIMER_CLK_FREQ 12500000
include/configs/ls1021atwr.h +1 -1
@@ -415,7 +415,7 @@#define CONFIG_ARMV7_NONSEC #define CONFIG_ARMV7_VIRT #define CONFIG_PEN_ADDR_BIG_ENDIAN -#define CONFIG_LS102XA_NS_ACCESS +#define CONFIG_LAYERSCAPE_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200#define CONFIG_TIMER_CLK_FREQ 12500000
include/fsl_csu.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* Copyright 2015 Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +* +*/ + +#ifndef __FSL_CSU_H__ +#define __FSL_CSU_H__ + +enum csu_cslx_access { +CSU_NS_SUP_R =0x08 , +CSU_NS_SUP_W =0x80 , +CSU_NS_SUP_RW =0x88 , +CSU_NS_USER_R =0x04 , +CSU_NS_USER_W =0x40 , +CSU_NS_USER_RW =0x44 , +CSU_S_SUP_R =0x02 , +CSU_S_SUP_W =0x20 , +CSU_S_SUP_RW =0x22 , +CSU_S_USER_R =0x01 , +CSU_S_USER_W =0x10 , +CSU_S_USER_RW =0x11 , +CSU_ALL_RW =0xff , +}; + +struct csu_ns_dev { +unsigned long ind; +uint32_t val; +}; + +void enable_layerscape_ns_access (void ); + +#endif
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 3/17 net/fm: Fix the endian issue to support both endianness platforms
In reply to Gong QianyuFrom: Hou Zhiqiang <[email protected]>
The Frame Manager(FMan) is a big-endian peripheral, so the registers, internal MURAM and BDs, which are allocated in main memory and used to communication between core and FMan, should be accessed in big-endian. The big-endian platforms can access them directly as the code implemented so far, while for the little-endian platforms it need to swap the byte-order.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- Modify the subject to make the aim clear.
V2:
- No change.
drivers/net/fm/eth.c | 70 +++++++++++++++++++++++++++------------------------- drivers/net/fm/fm.c | 11 +++++---- 2 files changed, 43 insertions(+), 38 deletions(-)
drivers/net/fm/eth.c +37 -33
@@ -109,7 +109,7 @@ static int tgec_is_fibre(struct eth_device *dev)static u16 muram_readw (u16 *addr) {u32 base = (u32 )addr & ~0x3 ; -u32 val32 = *(u32 *)base; +u32 val32 =in_be32 ((u32 *)base);int byte_pos;u16 ret;
@@ -125,7 +125,7 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) {u32 base = (u32 )addr & ~0x3 ; -u32 org32 = *(u32 *)base; +u32 org32 =in_be32 ((u32 *)base);u32 val32;int byte_pos;
@@ -135,7 +135,7 @@ static void muram_writew(u16 *addr, u16 val)else val32 = (org32 &0x0000ffff ) | ((u32 )val <<16 ); - *(u32 *)base = val32; +out_be32 ((u32 *)base, val32); }static void bmi_rx_port_disable (struct fm_bmi_rx_port *rx_port)
@@ -213,10 +213,10 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index);/* enable global mode- snooping data buffers and BDs */ - pram->mode =PRAM_MODE_GLOBAL ; +out_be32 (&pram->mode,PRAM_MODE_GLOBAL );/* init the Rx queue descriptor pionter */ - pram->rxqd_ptr = pram_page_offset +0x20 ; +out_be32 (&pram->rxqd_ptr, pram_page_offset +0x20 );/* set the max receive buffer length, power of 2 */ muram_writew (&pram->mrblr,MAX_RXBUF_LOG2 );
@@ -243,10 +243,11 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)/* init Rx BDs ring */ rxbd = (struct fm_port_bd *)rx_bd_ring_base;for (i =0 ; i <RX_BD_RING_SIZE ; i++) { - rxbd->status = RxBD_EMPTY; - rxbd->len =0 ; - rxbd->buf_ptr_hi =0 ; - rxbd->buf_ptr_lo = (u32 )rx_buf_pool + i *MAX_RXBUF_LEN ; +muram_writew (&rxbd->status, RxBD_EMPTY); +muram_writew (&rxbd->len,0 ); +muram_writew (&rxbd->buf_ptr_hi,0 ); +out_be32 (&rxbd->buf_ptr_lo, (u32 )rx_buf_pool + + i *MAX_RXBUF_LEN ); rxbd++; }
@@ -254,7 +255,7 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) rxqd = &pram->rxqd;muram_writew (&rxqd->gen,0 );muram_writew (&rxqd->bd_ring_base_hi,0 ); - rxqd->bd_ring_base_lo = (u32 )rx_bd_ring_base; +out_be32 (&rxqd->bd_ring_base_lo, (u32 )rx_bd_ring_base);muram_writew (&rxqd->bd_ring_size,sizeof (struct fm_port_bd ) *RX_BD_RING_SIZE );muram_writew (&rxqd->offset_in,0 );
@@ -285,10 +286,10 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth) pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index);/* enable global mode- snooping data buffers and BDs */ - pram->mode =PRAM_MODE_GLOBAL ; +out_be32 (&pram->mode,PRAM_MODE_GLOBAL );/* init the Tx queue descriptor pionter */ - pram->txqd_ptr = pram_page_offset +0x40 ; +out_be32 (&pram->txqd_ptr, pram_page_offset +0x40 );/* alloc Tx buffer descriptors from main memory */ tx_bd_ring_base = malloc(sizeof(struct fm_port_bd)
@@ -304,16 +305,17 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)/* init Tx BDs ring */ txbd = (struct fm_port_bd *)tx_bd_ring_base;for (i =0 ; i <TX_BD_RING_SIZE ; i++) { - txbd->status = TxBD_LAST; - txbd->len =0 ; - txbd->buf_ptr_hi =0 ; - txbd->buf_ptr_lo =0 ; +muram_writew (&txbd->status, TxBD_LAST); +muram_writew (&txbd->len,0 ); +muram_writew (&txbd->buf_ptr_hi,0 ); +out_be32 (&txbd->buf_ptr_lo,0 ); + txbd++; }/* set the Tx queue decriptor */ txqd = &pram->txqd;muram_writew (&txqd->bd_ring_base_hi,0 ); - txqd->bd_ring_base_lo = (u32 )tx_bd_ring_base; +out_be32 (&txqd->bd_ring_base_lo, (u32 )tx_bd_ring_base);muram_writew (&txqd->bd_ring_size,sizeof (struct fm_port_bd ) *TX_BD_RING_SIZE );muram_writew (&txqd->offset_in,0 );
@@ -368,7 +370,7 @@ static void fmc_tx_port_graceful_stop_enable(struct fm_eth *fm_eth) pram = fm_eth->tx_pram;/* graceful stop transmission of frames */ - pram->mode |=PRAM_MODE_GRACEFUL_STOP ; +setbits_be32 (&pram->mode,PRAM_MODE_GRACEFUL_STOP );sync (); }
@@ -378,7 +380,7 @@ static void fmc_tx_port_graceful_stop_disable(struct fm_eth *fm_eth) pram = fm_eth->tx_pram;/* re-enable transmission of frames */ - pram->mode &= ~PRAM_MODE_GRACEFUL_STOP ; +clrbits_be32 (&pram->mode,PRAM_MODE_GRACEFUL_STOP );sync (); }
@@ -469,19 +471,20 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len) txbd = fm_eth->cur_txbd;/* find one empty TxBD */ -for (i =0 ; txbd->status & TxBD_READY; i++) { +for (i =0 ;muram_readw (&txbd->status) & TxBD_READY; i++) {udelay (100 );if (i >0x1000 ) { -printf ("%s: Tx buffer not ready\n" , dev->name); +printf ("%s: Tx buffer not ready, txbd->status = 0x%x\n" , + dev->name,muram_readw (&txbd->status));return 0 ; } }/* setup TxBD */ - txbd->buf_ptr_hi =0 ; - txbd->buf_ptr_lo = (u32 )buf; - txbd->len = len; +muram_writew (&txbd->buf_ptr_hi,0 ); +out_be32 (&txbd->buf_ptr_lo, (u32 )buf); +muram_writew (&txbd->len, len);sync (); - txbd->status = TxBD_READY | TxBD_LAST; +muram_writew (&txbd->status, TxBD_READY | TxBD_LAST);sync ();/* update TxQD, let RISC to send the packet */
@@ -493,10 +496,11 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len)sync ();/* wait for buffer to be transmitted */ -for (i =0 ; txbd->status & TxBD_READY; i++) { +for (i =0 ;muram_readw (&txbd->status) & TxBD_READY; i++) {udelay (100 );if (i >0x10000 ) { -printf ("%s: Tx error\n" , dev->name); +printf ("%s: Tx error, txbd->status = 0x%x\n" , + dev->name,muram_readw (&txbd->status));return 0 ; } }
@@ -525,12 +529,12 @@ static int fm_eth_recv(struct eth_device *dev) fm_eth = (struct fm_eth *)dev->priv; pram = fm_eth->rx_pram; rxbd = fm_eth->cur_rxbd; - status = rxbd->status; + status =muram_readw (&rxbd->status);while (!(status & RxBD_EMPTY)) {if (!(status & RxBD_ERROR)) { - data = (u8 *)rxbd->buf_ptr_lo; - len = rxbd->len; + data = (u8 *)in_be32 (&rxbd->buf_ptr_lo); + len =muram_readw (&rxbd->len);net_process_received_packet (data, len); }else {printf ("%s: Rx error\n" , dev->name);
@@ -538,8 +542,8 @@ static int fm_eth_recv(struct eth_device *dev) }/* clear the RxBDs */ - rxbd->status = RxBD_EMPTY; - rxbd->len =0 ; +muram_writew (&rxbd->status, RxBD_EMPTY); +muram_writew (&rxbd->len,0 );sync ();/* advance RxBD */
@@ -548,7 +552,7 @@ static int fm_eth_recv(struct eth_device *dev)if (rxbd >= (rxbd_base +RX_BD_RING_SIZE )) rxbd = rxbd_base;/* read next status */ - status = rxbd->status; + status =muram_readw (&rxbd->status);/* update RxQD */ offset_out =muram_readw (&pram->rxqd.offset_out);
drivers/net/fm/fm.c +6 -5
@@ -80,11 +80,11 @@ static void fm_upload_ucode(int fm_idx, struct fm_imem *imem,out_be32 (&imem->iadd,IRAM_IADD_AIE );/* write microcode to IRAM */ for (i =0 ; i < size /4 ; i++) -out_be32 (&imem->idata, ucode[i]); +out_be32 (&imem->idata, (be32_to_cpu (ucode[i])));/* verify if the writing is over */ out_be32 (&imem->iadd,0 ); -while ((in_be32 (&imem->idata) != ucode[0 ]) && --timeout) +while ((in_be32 (&imem->idata) !=be32_to_cpu (ucode[0 ])) && --timeout) ;if (!timeout)printf ("Fman%u: microcode upload timeout\n" , fm_idx +1 );
@@ -177,14 +177,15 @@ static int fman_upload_firmware(int fm_idx,const struct qe_microcode *ucode = &firmware->microcode[i];/* Upload a microcode if it's present */ -if (ucode->code_offset) { +if (be32_to_cpu (ucode->code_offset)) {u32 ucode_size;u32 *code;printf ("Fman%u: Uploading microcode version %u.%u.%u\n" , fm_idx +1 , ucode->major, ucode->minor, ucode->revision); - code = (void *)firmware + ucode->code_offset; - ucode_size =sizeof (u32) * ucode->count; + code = (void *)firmware + +be32_to_cpu (ucode->code_offset); + ucode_size =sizeof (u32) *be32_to_cpu (ucode->count);fm_upload_ucode (fm_idx, fm_imem, code, ucode_size); } }
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 4/17 net/fm: Add support for 64-bit platforms
In reply to Gong QianyuFrom: Hou Zhiqiang <[email protected]>
The FMan IM driver is developed for 32-bit platfroms and isn't friendly to 64-bit platforms, so do the minimal refactor:
1. Refine the MURAM management and access.
2. Correct the initialization and operations for QDs and BDs.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- New patch.
drivers/net/fm/eth.c | 61 ++++++++++++++++++++++++++++++++++++---------------- drivers/net/fm/fm.c | 20 ++++++++++------- drivers/net/fm/fm.h | 12 +++++------ 3 files changed, 60 insertions(+), 33 deletions(-)
drivers/net/fm/eth.c +42 -19
@@ -108,12 +108,12 @@ static int tgec_is_fibre(struct eth_device *dev)static u16 muram_readw (u16 *addr) { -u32 base = (u32 )addr & ~0x3 ; -u32 val32 =in_be32 ((u32 *)base); +ulong base = (ulong )addr & ~0x3UL ; +u32 val32 =in_be32 ((void *)base);int byte_pos;u16 ret; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3UL ;if (byte_pos) ret = (u16)(val32 &0x0000ffff );else
@@ -124,18 +124,18 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) { -u32 base = (u32 )addr & ~0x3 ; -u32 org32 =in_be32 ((u32 *)base); +ulong base = (ulong )addr & ~0x3UL ; +u32 org32 =in_be32 ((void *)base);u32 val32;int byte_pos; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3UL ;if (byte_pos) val32 = (org32 &0xffff0000 ) | val;else val32 = (org32 &0x0000ffff ) | ((u32 )val <<16 ); -out_be32 ((u32 *)base, val32); +out_be32 ((void *)base, val32); }static void bmi_rx_port_disable (struct fm_bmi_rx_port *rx_port)
@@ -199,6 +199,8 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)u32 pram_page_offset;void *rx_bd_ring_base;void *rx_buf_pool; +u32 bd_ring_base_lo, bd_ring_base_hi; +u32 buf_lo, buf_hi;struct fm_port_bd *rxbd;struct fm_port_qd *rxqd;struct fm_bmi_rx_port *bmi_rx_port = fm_eth->rx_port;
@@ -207,10 +209,15 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)/* alloc global parameter ram at MURAM */ pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN ); +if (!pram) { +printf ("%s: No muram for Rx global parameter\n" , __func__); +return 0 ; + } + fm_eth->rx_pram = pram;/* parameter page offset to MURAM */ - pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index); + pram_page_offset = (void *)pram -fm_muram_base (fm_eth->fm_index);/* enable global mode- snooping data buffers and BDs */ out_be32 (&pram->mode,PRAM_MODE_GLOBAL );
@@ -234,6 +241,7 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)if (!rx_buf_pool)return 0 ;memset (rx_buf_pool,0 ,MAX_RXBUF_LEN *RX_BD_RING_SIZE ); +debug ("%s: rx_buf_pool = %p\n" , __func__, rx_buf_pool);/* save them to fm_eth */ fm_eth->rx_bd_ring = rx_bd_ring_base;
@@ -245,17 +253,22 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)for (i =0 ; i <RX_BD_RING_SIZE ; i++) {muram_writew (&rxbd->status, RxBD_EMPTY);muram_writew (&rxbd->len,0 ); -muram_writew (&rxbd->buf_ptr_hi,0 ); -out_be32 (&rxbd->buf_ptr_lo, (u32 )rx_buf_pool + - i *MAX_RXBUF_LEN ); + buf_hi =upper_32_bits (virt_to_phys (rx_buf_pool + + i *MAX_RXBUF_LEN )); + buf_lo =lower_32_bits (virt_to_phys (rx_buf_pool + + i *MAX_RXBUF_LEN )); +muram_writew (&rxbd->buf_ptr_hi, (u16 )buf_hi); +out_be32 (&rxbd->buf_ptr_lo, buf_lo); rxbd++; }/* set the Rx queue descriptor */ rxqd = &pram->rxqd;muram_writew (&rxqd->gen,0 ); -muram_writew (&rxqd->bd_ring_base_hi,0 ); -out_be32 (&rxqd->bd_ring_base_lo, (u32 )rx_bd_ring_base); + bd_ring_base_hi =upper_32_bits (virt_to_phys (rx_bd_ring_base)); + bd_ring_base_lo =lower_32_bits (virt_to_phys (rx_bd_ring_base)); +muram_writew (&rxqd->bd_ring_base_hi, (u16 )bd_ring_base_hi); +out_be32 (&rxqd->bd_ring_base_lo, bd_ring_base_lo);muram_writew (&rxqd->bd_ring_size,sizeof (struct fm_port_bd ) *RX_BD_RING_SIZE );muram_writew (&rxqd->offset_in,0 );
@@ -272,6 +285,7 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)struct fm_port_global_pram *pram;u32 pram_page_offset;void *tx_bd_ring_base; +u32 bd_ring_base_lo, bd_ring_base_hi;struct fm_port_bd *txbd;struct fm_port_qd *txqd;struct fm_bmi_tx_port *bmi_tx_port = fm_eth->tx_port;
@@ -280,10 +294,14 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)/* alloc global parameter ram at MURAM */ pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN ); +if (!pram) { +printf ("%s: No muram for Tx global parameter\n" , __func__); +return 0 ; + } fm_eth->tx_pram = pram;/* parameter page offset to MURAM */ - pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index); + pram_page_offset = (void *)pram -fm_muram_base (fm_eth->fm_index);/* enable global mode- snooping data buffers and BDs */ out_be32 (&pram->mode,PRAM_MODE_GLOBAL );
@@ -314,8 +332,10 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)/* set the Tx queue decriptor */ txqd = &pram->txqd; -muram_writew (&txqd->bd_ring_base_hi,0 ); -out_be32 (&txqd->bd_ring_base_lo, (u32 )tx_bd_ring_base); + bd_ring_base_hi =upper_32_bits (virt_to_phys (tx_bd_ring_base)); + bd_ring_base_lo =lower_32_bits (virt_to_phys (tx_bd_ring_base)); +muram_writew (&txqd->bd_ring_base_hi, (u16 )bd_ring_base_hi); +out_be32 (&txqd->bd_ring_base_lo, bd_ring_base_lo);muram_writew (&txqd->bd_ring_size,sizeof (struct fm_port_bd ) *TX_BD_RING_SIZE );muram_writew (&txqd->offset_in,0 );
@@ -480,8 +500,8 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len) } }/* setup TxBD */ -muram_writew (&txbd->buf_ptr_hi,0 ); -out_be32 (&txbd->buf_ptr_lo, (u32 )buf); +muram_writew (&txbd->buf_ptr_hi, (u16 )upper_32_bits (virt_to_phys (buf))); +out_be32 (&txbd->buf_ptr_lo,lower_32_bits (virt_to_phys (buf)));muram_writew (&txbd->len, len);sync ();muram_writew (&txbd->status, TxBD_READY | TxBD_LAST);
@@ -522,6 +542,7 @@ static int fm_eth_recv(struct eth_device *dev)struct fm_port_global_pram *pram;struct fm_port_bd *rxbd, *rxbd_base;u16 status, len; +u32 buf_lo, buf_hi;u8 *data;u16 offset_out;int ret =1 ;
@@ -533,7 +554,9 @@ static int fm_eth_recv(struct eth_device *dev)while (!(status & RxBD_EMPTY)) {if (!(status & RxBD_ERROR)) { - data = (u8 *)in_be32 (&rxbd->buf_ptr_lo); + buf_hi =muram_readw (&rxbd->buf_ptr_hi); + buf_lo =in_be32 (&rxbd->buf_ptr_lo); + data = (u8 *)((ulong)(buf_hi <<16 ) <<16 | buf_lo); len =muram_readw (&rxbd->len);net_process_received_packet (data, len); }else {
drivers/net/fm/fm.c +12 -8
@@ -22,21 +22,22 @@struct fm_muram muram[CONFIG_SYS_NUM_FMAN ]; -u32 fm_muram_base (int fm_idx) +void *fm_muram_base (int fm_idx) {return muram[fm_idx].base; } -u32 fm_muram_alloc (int fm_idx,u32 size,u32 align) +void *fm_muram_alloc (int fm_idx,size_t size,ulong align) { -u32 ret; -u32 align_mask, off; -u32 save; +void *ret; +ulong align_mask; +size_t off; +void *save; align_mask = align -1 ; save = muram[fm_idx].alloc; - off = save & align_mask; + off = (ulong )save & align_mask;if (off !=0 ) muram[fm_idx].alloc += (align - off); off = size & align_mask;
@@ -45,6 +46,7 @@ u32 fm_muram_alloc(int fm_idx, u32 size, u32 align)if ((muram[fm_idx].alloc + size) >= muram[fm_idx].top) { muram[fm_idx].alloc = save;printf ("%s: run out of ram.\n" , __func__); +return NULL ; } ret = muram[fm_idx].alloc;
@@ -56,7 +58,7 @@ u32 fm_muram_alloc(int fm_idx, u32 size, u32 align)static void fm_init_muram (int fm_idx,void *reg) { -u32 base = (u32 )reg; +void *base = reg; muram[fm_idx].base = base; muram[fm_idx].size =CONFIG_SYS_FM_MURAM_SIZE ;
@@ -256,7 +258,9 @@ static void fm_init_fpm(struct fm_fpm *fpm)static int fm_init_bmi (int fm_idx,struct fm_bmi_common *bmi) {int blk, i, port_id; -u32 val, offset, base; +u32 val; +size_t offset; +void *base;/* alloc free buffer pool in MURAM */ base =fm_muram_alloc (fm_idx,FM_FREE_POOL_SIZE ,FM_FREE_POOL_ALIGN );
drivers/net/fm/fm.h +6 -6
@@ -26,10 +26,10 @@#define MIIM_TIMEOUT 0xFFFFstruct fm_muram { -u32 base; -u32 top; -u32 size; -u32 alloc; +void *base; +void *top; +size_t size; +void *alloc; };#define FM_MURAM_RES_SIZE 0x01000
@@ -95,8 +95,8 @@ struct fm_port_global_pram {#endif #define FM_FREE_POOL_ALIGN 256 -u32 fm_muram_alloc (int fm_idx,u32 size,u32 align); -u32 fm_muram_base (int fm_idx); +void *fm_muram_alloc (int fm_idx,size_t size,ulong align); +void *fm_muram_base (int fm_idx);int fm_init_common (int index,struct ccsr_fman *reg);int fm_eth_initialize (struct ccsr_fman *reg,struct fm_eth_info *info);phy_interface_t fman_port_enet_if (enum fm_port port);
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 5/17 net/fm: Make the return value logic consistent with convention
In reply to Gong QianyuFrom: Hou Zhiqiang <[email protected]>
In convention, the '0' is a normal return value indicating there isn't an error. While some functions of FMan IM driver treat '0' as an error return value.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- New patch.
drivers/net/fm/eth.c | 60 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 24 deletions(-)
drivers/net/fm/eth.c +36 -24
@@ -211,7 +211,7 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) FM_PRAM_SIZE, FM_PRAM_ALIGN);if (!pram) {printf ("%s: No muram for Rx global parameter\n" , __func__); -return 0 ; +return -ENOMEM ; } fm_eth->rx_pram = pram;
@@ -232,14 +232,16 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) rx_bd_ring_base =malloc (sizeof (struct fm_port_bd ) *RX_BD_RING_SIZE );if (!rx_bd_ring_base) -return 0 ; +return -ENOMEM ; +memset (rx_bd_ring_base,0 ,sizeof (struct fm_port_bd ) *RX_BD_RING_SIZE );/* alloc Rx buffer from main memory */ rx_buf_pool =malloc (MAX_RXBUF_LEN *RX_BD_RING_SIZE );if (!rx_buf_pool) -return 0 ; +return -ENOMEM ; +memset (rx_buf_pool,0 ,MAX_RXBUF_LEN *RX_BD_RING_SIZE );debug ("%s: rx_buf_pool = %p\n" , __func__, rx_buf_pool);
@@ -277,7 +279,7 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)/* set IM parameter ram pointer to Rx Frame Queue ID */ out_be32 (&bmi_rx_port->fmbm_rfqid, pram_page_offset); -return 1 ; +return 0 ; }static int fm_eth_tx_port_parameter_init (struct fm_eth *fm_eth)
@@ -296,7 +298,7 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth) FM_PRAM_SIZE, FM_PRAM_ALIGN);if (!pram) {printf ("%s: No muram for Tx global parameter\n" , __func__); -return 0 ; +return -ENOMEM ; } fm_eth->tx_pram = pram;
@@ -313,7 +315,8 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth) tx_bd_ring_base =malloc (sizeof (struct fm_port_bd ) *TX_BD_RING_SIZE );if (!tx_bd_ring_base) -return 0 ; +return -ENOMEM ; +memset (tx_bd_ring_base,0 ,sizeof (struct fm_port_bd ) *TX_BD_RING_SIZE );/* save it to fm_eth */
@@ -344,29 +347,35 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)/* set IM parameter ram pointer to Tx Confirmation Frame Queue ID */ out_be32 (&bmi_tx_port->fmbm_tcfqid, pram_page_offset); -return 1 ; +return 0 ; }static int fm_eth_init (struct fm_eth *fm_eth) { +int ret; -if (!fm_eth_rx_port_parameter_init (fm_eth)) -return 0 ; + ret =fm_eth_rx_port_parameter_init (fm_eth); +if (ret) +return ret; -if (!fm_eth_tx_port_parameter_init (fm_eth)) -return 0 ; + ret =fm_eth_tx_port_parameter_init (fm_eth); +if (ret) +return ret; -return 1 ; +return 0 ; }static int fm_eth_startup (struct fm_eth *fm_eth) {struct fsl_enet_mac *mac; +int ret; + mac = fm_eth->mac;/* Rx/TxBDs, Rx/TxQDs, Rx buff and parameter ram init */ -if (!fm_eth_init (fm_eth)) -return 0 ; + ret =fm_eth_init (fm_eth); +if (ret) +return ret;/* setup the MAC controller */ mac->init_mac (mac);
@@ -381,7 +390,7 @@ static int fm_eth_startup(struct fm_eth *fm_eth)/* init bmi tx port, IM mode and disable */ bmi_tx_port_init (fm_eth->tx_port); -return 1 ; +return 0 ; }static void fmc_tx_port_graceful_stop_enable (struct fm_eth *fm_eth)
@@ -628,7 +637,7 @@ static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)/* alloc mac controller */ mac =malloc (sizeof (struct fsl_enet_mac ));if (!mac) -return 0 ; +return -ENOMEM ;memset (mac,0 ,sizeof (struct fsl_enet_mac ));/* save the mac to fm_eth struct */
@@ -643,7 +652,7 @@ static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)init_tgec (mac, base, phyregs,MAX_RXBUF_LEN );#endif -return 1 ; +return 0 ; }static int init_phy (struct eth_device *dev)
@@ -696,17 +705,18 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)struct eth_device *dev;struct fm_eth *fm_eth;int i, num = info->num; +int ret;/* alloc eth device */ dev = (struct eth_device *)malloc (sizeof (struct eth_device ));if (!dev) -return 0 ; +return -ENOMEM ;memset (dev,0 ,sizeof (struct eth_device ));/* alloc the FMan ethernet private struct */ fm_eth = (struct fm_eth *)malloc (sizeof (struct fm_eth ));if (!fm_eth) -return 0 ; +return -ENOMEM ;memset (fm_eth,0 ,sizeof (struct fm_eth ));/* save off some things we need from the info struct */
@@ -721,8 +731,9 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) fm_eth->max_rx_len =MAX_RXBUF_LEN ;/* init global mac structure */ -if (!fm_eth_init_mac (fm_eth, reg)) -return 0 ; + ret =fm_eth_init_mac (fm_eth, reg); +if (ret) +return ret;/* keep same as the manual, we call FMAN1, FMAN2, DTSEC1, DTSEC2, etc */ if (fm_eth->type ==FM_ETH_1G_E )
@@ -743,8 +754,9 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) fm_eth->enet_if = info->enet_if;/* startup the FM im */ -if (!fm_eth_startup (fm_eth)) -return 0 ; + ret =fm_eth_startup (fm_eth); +if (ret) +return ret;init_phy (dev);
@@ -753,5 +765,5 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info) dev->enetaddr[i] =0 ;eth_register (dev); -return 1 ; +return 0 ; }
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 6/17 net: fm: bug fix when CONFIG_PHYLIB not defined
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
codes related to phylib operations should be wrapped by CONFIG_PHYLIB.
---
V8:
- No changes.
V7:
- No change.
V6:
- Fix all codes related to phylib to be wrapped by CONFIG_PHYLIB.
V5:
- No change.
V4:
- No change.
V3:
- New patch.
drivers/net/fm/eth.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/fm/eth.c +7 -1
@@ -95,6 +95,7 @@ static void dtsec_init_phy(struct eth_device *dev)dtsec_configure_serdes (fm_eth); } +#ifdef CONFIG_PHYLIB static int tgec_is_fibre (struct eth_device *dev) {struct fm_eth *fm = dev->priv;
@@ -105,6 +106,7 @@ static int tgec_is_fibre(struct eth_device *dev)return hwconfig_arg_cmp (phyopt,"xfi" ); }#endif +#endif static u16 muram_readw (u16 *addr) {
@@ -483,8 +485,10 @@ static void fm_eth_halt(struct eth_device *dev)/* disable bmi Rx port */ bmi_rx_port_disable (fm_eth->rx_port); +#ifdef CONFIG_PHYLIB if (fm_eth->phydev)phy_shutdown (fm_eth->phydev); +#endif }static int fm_eth_send (struct eth_device *dev,void *buf,int len)
@@ -658,13 +662,15 @@ static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)static int init_phy (struct eth_device *dev) {struct fm_eth *fm_eth = dev->priv; +#ifdef CONFIG_PHYLIB struct phy_device *phydev =NULL ;u32 supported; +#endif -#ifdef CONFIG_PHYLIB if (fm_eth->type ==FM_ETH_1G_E )dtsec_init_phy (dev); +#ifdef CONFIG_PHYLIB if (fm_eth->bus) { phydev =phy_connect (fm_eth->bus, fm_eth->phyaddr, dev, fm_eth->enet_if);
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 7/17 net: Move some header files to include/
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
The fsl_dtsec.h & fsl_tgec.h & fsl_fman.h can be shared on both ARM and PPC, move it out of ppc to include/, and change the path in drivers accordingly.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- No change.
V2:
- No change.
arch/powerpc/include/asm/immap_85xx.h | 2 +-
board/freescale/b4860qds/eth_b4860qds.c | 2 +-
board/freescale/corenet_ds/eth_hydra.c | 2 +-
board/freescale/corenet_ds/eth_p4080.c | 2 +-
board/freescale/corenet_ds/eth_superhydra.c | 2 +-
board/freescale/p1023rdb/p1023rdb.c | 2 +-
board/freescale/p2041rdb/eth.c | 2 +-
board/freescale/t102xqds/eth_t102xqds.c | 2 +-
board/freescale/t102xrdb/eth_t102xrdb.c | 2 +-
board/freescale/t1040qds/eth.c | 2 +-
board/freescale/t104xrdb/eth.c | 2 +-
board/freescale/t208xqds/eth_t208xqds.c | 2 +-
board/freescale/t208xrdb/eth_t208xrdb.c | 2 +-
board/freescale/t4qds/eth.c | 2 +-
board/freescale/t4rdb/eth.c | 2 +-
drivers/net/fm/dtsec.c | 2 +-
drivers/net/fm/eth.c | 4 ++--
drivers/net/fm/fm.h | 2 +-
drivers/net/fm/tgec.c | 2 +-
drivers/net/fm/tgec_phy.c | 2 +-
{arch/powerpc/include/asm => include}/fsl_dtsec.h | 0
{arch/powerpc/include/asm => include}/fsl_fman.h | 0
{arch/powerpc/include/asm => include}/fsl_tgec.h | 0
23 files changed, 21 insertions(+), 21 deletions(-)arch/powerpc/include/asm/immap_85xx.h +1 -1
@@ -19,7 +19,7 @@#include <fsl_sec.h> #include <fsl_sfp.h> #include <asm/fsl_lbc.h> -#include <asm/fsl_fman.h> +#include <fsl_fman.h> #include <fsl_immap.h> typedef struct ccsr_local {
board/freescale/b4860qds/eth_b4860qds.c +1 -1
@@ -26,7 +26,7 @@#include <fsl_mdio.h> #include <malloc.h> #include <fdt_support.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "../common/ngpixis.h" #include "../common/fman.h"
board/freescale/corenet_ds/eth_hydra.c +1 -1
@@ -55,7 +55,7 @@#include <fsl_mdio.h> #include <malloc.h> #include <fdt_support.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "../common/ngpixis.h" #include "../common/fman.h"
board/freescale/corenet_ds/eth_p4080.c +1 -1
@@ -24,7 +24,7 @@#include "../common/ngpixis.h" #include "../common/fman.h" -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #define EMI_NONE 0xffffffff#define EMI_MASK 0xf0000000
board/freescale/corenet_ds/eth_superhydra.c +1 -1
@@ -55,7 +55,7 @@#include <fsl_mdio.h> #include <malloc.h> #include <fdt_support.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "../common/ngpixis.h" #include "../common/fman.h"
board/freescale/p1023rdb/p1023rdb.c +1 -1
@@ -26,7 +26,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> DECLARE_GLOBAL_DATA_PTR ;
board/freescale/p2041rdb/eth.c +1 -1
@@ -19,7 +19,7 @@#include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "cpld.h" #include "../common/fman.h"
board/freescale/t102xqds/eth_t102xqds.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include "../common/qixis.h" #include "../common/fman.h"
board/freescale/t102xrdb/eth_t102xrdb.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include "../common/fman.h"
board/freescale/t1040qds/eth.c +1 -1
@@ -17,7 +17,7 @@#include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <vsc9953.h> #include "../common/fman.h"
board/freescale/t104xrdb/eth.c +1 -1
@@ -11,7 +11,7 @@#include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <vsc9953.h> #include "../common/fman.h"
board/freescale/t208xqds/eth_t208xqds.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include <hwconfig.h> #include "../common/qixis.h"
board/freescale/t208xrdb/eth_t208xrdb.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> int board_eth_init (bd_t *bis)
board/freescale/t4qds/eth.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include <hwconfig.h> #include "../common/qixis.h"
board/freescale/t4rdb/eth.c +1 -1
@@ -23,7 +23,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include <hwconfig.h>
drivers/net/fm/dtsec.c +1 -1
@@ -7,7 +7,7 @@#include <common.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <fsl_mdio.h> #include <phy.h>
drivers/net/fm/eth.c +2 -2
@@ -13,8 +13,8 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> -#include <asm/fsl_tgec.h> +#include <fsl_dtsec.h> +#include <fsl_tgec.h> #include <fsl_memac.h> #include "fm.h"
drivers/net/fm/fm.h +1 -1
@@ -10,7 +10,7 @@#include <common.h> #include <phy.h> #include <fm_eth.h> -#include <asm/fsl_fman.h> +#include <fsl_fman.h> /* Port ID */ #define OH_PORT_ID_BASE 0x01
drivers/net/fm/tgec.c +1 -1
@@ -12,7 +12,7 @@#include <phy.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_tgec.h> +#include <fsl_tgec.h> #include "fm.h"
drivers/net/fm/tgec_phy.c +1 -1
@@ -9,7 +9,7 @@#include <miiphy.h> #include <phy.h> #include <asm/io.h> -#include <asm/fsl_tgec.h> +#include <fsl_tgec.h> #include <fm_eth.h> /*
include/fsl_dtsec.h renamed from arch/powerpc/include/asm/fsl_dtsec.h +0 -0
include/fsl_fman.h renamed from arch/powerpc/include/asm/fsl_fman.h +0 -0
include/fsl_tgec.h renamed from arch/powerpc/include/asm/fsl_tgec.h +0 -0
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 8/17 net/fm: Add QSGMII PCS init
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
QSGMII PCS needed to be programmed same as SGMII PCS, and there are four ports in QSGMII PCS, port 0, 1, 2, 3, all the four ports shared port 0's MDIO controller, so when programming port 0, we continue to program other three ports.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- Remove the "if(priv->phyaddr%4 != 0)" condition in qsgmii_loop.
V3:
- No change.
V2:
- No change.
drivers/net/fm/eth.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/net/fm/eth.c +13 -5
@@ -41,28 +41,35 @@ static void dtsec_configure_serdes(struct fm_eth *priv) bus.priv = priv->mac->phyregs;bool sgmii_2500 = (priv->enet_if ==PHY_INTERFACE_MODE_SGMII_2500 ) ? true : false; +int i =0 ; +qsgmii_loop:/* SGMII IF mode + AN enable only for 1G SGMII, not for 2.5G */ value =PHY_SGMII_IF_MODE_SGMII ;if (!sgmii_2500) value |=PHY_SGMII_IF_MODE_AN ; -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x14 , value); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x14 , value);/* Dev ability according to SGMII specification */ value =PHY_SGMII_DEV_ABILITY_SGMII ; -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x4 , value); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x4 , value);/* Adjust link timer for SGMII - 1.6 ms in units of 8 ns = 2 * 10^5 = 0x30d40 */ -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x13 ,0x3 ); -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x12 ,0xd40 ); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x13 ,0x3 ); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x12 ,0xd40 );/* Restart AN */ value =PHY_SGMII_CR_DEF_VAL ;if (!sgmii_2500) value |=PHY_SGMII_CR_RESET_AN ; -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0 , value); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0 , value); + +if ((priv->enet_if ==PHY_INTERFACE_MODE_QSGMII ) && (i <3 )) { + i++; + goto qsgmii_loop; + }#else struct dtsec *regs = priv->mac->base;struct tsec_mii_mng *phyregs = priv->mac->phyregs;
@@ -91,6 +98,7 @@ static void dtsec_init_phy(struct eth_device *dev)#endif if (fm_eth->enet_if ==PHY_INTERFACE_MODE_SGMII || + fm_eth->enet_if ==PHY_INTERFACE_MODE_QSGMII || fm_eth->enet_if ==PHY_INTERFACE_MODE_SGMII_2500 )dtsec_configure_serdes (fm_eth); }
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 9/17 net/fm: fix MDIO controller base on FMAN2
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
MDIO controller base on FMAN2 was defined as CONFIG_SYS_FSL_FM2_ADDR plus offset, but CONFIG_SYS_FSL_FM2_ADDR only defined when there are two FMANs, so we should only define MDIO controller base on FMAN2 when there is FMAN2.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- No change.
V2:
- No change.
include/fm_eth.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
include/fm_eth.h +17 -0
@@ -45,8 +45,10 @@ enum fm_eth_type {#ifdef CONFIG_SYS_FMAN_V3 #define CONFIG_SYS_FM1_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xfc000)#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xfd000) +#if (CONFIG_SYS_NUM_FMAN ==2 )#define CONFIG_SYS_FM2_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR + 0xfc000)#define CONFIG_SYS_FM2_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR + 0xfd000) +#endif #else #define CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xe1120)#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xf1000)
@@ -89,6 +91,7 @@ enum fm_eth_type { offsetof(struct ccsr_fman, memac[n-1]),\ }#else +#if (CONFIG_SYS_NUM_FMAN ==2 )#define FM_TGEC_INFO_INITIALIZER (idx, n) \ { \ FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM2_TGEC_MDIO_ADDR) \
@@ -101,6 +104,20 @@ enum fm_eth_type { .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ offsetof(struct ccsr_fman, memac[n-1+8]),\ } +#else +#define FM_TGEC_INFO_INITIALIZER (idx, n) \ +{ \ + FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR) \ + .index = idx, \ + .num = n - 1, \ + .type = FM_ETH_10G_E, \ + .port = FM##idx##_10GEC##n, \ + .rx_port_id = RX_PORT_10G_BASE + n - 1, \ + .tx_port_id = TX_PORT_10G_BASE + n - 1, \ + .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ + offsetof(struct ccsr_fman, memac[n-1+8]),\ +} +#endif #endif #if (CONFIG_SYS_NUM_FM1_10GEC >=3 )
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 10/17 armv8/fsl_lsch3: Change arch to fsl-layerscape
In reply to Gong QianyuFrom: Mingkai Hu <[email protected]>
There are two LS series processors are built on ARMv8 Layersacpe architecture currently, LS2085A and LS1043A. They are based on ARMv8 core although use different chassis, so create fsl-layerscape to refactor the common code for the LS series processors which also paves the way for adding LS1043A platform.
---
V8:
- No changes.
V7:
- Add Hou Zhiqiang Signed-off.
V6:
- Remove GIC SMMU TZPC macros from ls2085a_common.h to config.h.
- Modify fsl_lsch3_wake_secondary_cores() to fsl_layerscape_wake_seconday_cores()
- Fix lsch3->layerscape changes for ls2085a emu and simu.
V5:
- Move LS2085A ddr macros out of soc #ifdef.
- Move macros and structs from cpu.c to cpu.h.
- Wrap le32 and be32 functions for ccsr gur and scfg. Defined in soc.h
- Modify fsl-layerscape/Makefile.
V4:
- New patch.
arch/arm/cpu/armv8/Makefile | 2 +-
arch/arm/cpu/armv8/fsl-layerscape/Makefile | 21 ++
.../README => fsl-layerscape/README.lsch3} | 2 +-
.../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/cpu.c | 248 ++++++---------------
.../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/cpu.h | 2 +-
.../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/fdt.c | 17 +-
.../fsl_lsch3_serdes.c | 8 +-
.../speed.c => fsl-layerscape/fsl_lsch3_speed.c} | 12 +-
.../armv8/{fsl-lsch3 => fsl-layerscape}/lowlevel.S | 14 +-
.../{fsl-lsch3 => fsl-layerscape}/ls2085a_serdes.c | 3 +-
.../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/mp.c | 16 +-
.../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/soc.c | 35 +--
arch/arm/cpu/armv8/fsl-layerscape/spl.c | 76 +++++++
arch/arm/cpu/armv8/fsl-lsch3/Makefile | 13 --
arch/arm/cpu/armv8/fsl-lsch3/speed.h | 7 -
.../clock.h | 8 +-
arch/arm/include/asm/arch-fsl-layerscape/config.h | 96 ++++++++
arch/arm/include/asm/arch-fsl-layerscape/cpu.h | 165 ++++++++++++++
.../{arch-fsl-lsch3 => arch-fsl-layerscape}/fdt.h | 4 +
.../fsl_serdes.h | 11 +-
.../immap_lsch3.h | 119 ++++++++--
.../arm/include/asm/arch-fsl-layerscape/imx-regs.h | 55 +++++
.../ls2085a_stream_id.h | 0
arch/arm/include/asm/arch-fsl-layerscape/mmu.h | 10 +
.../asm/arch-fsl-layerscape}/mp.h | 10 +-
.../{arch-fsl-lsch3 => arch-fsl-layerscape}/soc.h | 21 +-
arch/arm/include/asm/arch-fsl-layerscape/speed.h | 10 +
arch/arm/include/asm/arch-fsl-lsch3/config.h | 185 ---------------
arch/arm/include/asm/arch-fsl-lsch3/gpio.h | 9 -
arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h | 13 --
arch/arm/include/asm/config.h | 7 +-
board/freescale/ls2085a/Kconfig | 4 +-
board/freescale/ls2085a/ls2085a.c | 2 +-
board/freescale/ls2085aqds/Kconfig | 2 +-
board/freescale/ls2085aqds/eth.c | 1 -
board/freescale/ls2085aqds/ls2085aqds.c | 2 +-
board/freescale/ls2085ardb/Kconfig | 2 +-
board/freescale/ls2085ardb/eth_ls2085rdb.c | 1 -
board/freescale/ls2085ardb/ls2085ardb.c | 2 +-
drivers/i2c/mxc_i2c.c | 4 +-
drivers/misc/fsl_debug_server.c | 1 -
drivers/net/ldpaa_eth/ls2085a.c | 2 -
drivers/pci/pcie_layerscape.c | 4 +-
include/common.h | 3 +
include/configs/ls2085a_common.h | 10 +-
45 files changed, 713 insertions(+), 526 deletions(-)arch/arm/cpu/armv8/Makefile +1 -1
@@ -15,6 +15,6 @@ obj-y += cache.o obj-y += tlb.o obj-y += transition.o -obj-$(CONFIG_FSL_LSCH3) += fsl-lsch3/ +obj-$(CONFIG_FSL_LAYERSCAPE) += fsl-layerscape/ obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/ obj-$(CONFIG_TARGET_HIKEY) += hisilicon/
arch/arm/cpu/armv8/fsl-layerscape/Makefile new file +21 -0
@@ -0,0 +1,21 @@ +# +# Copyright 2014-2015, Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpu.o +obj-y += lowlevel.o +obj-y += soc.o +obj-$(CONFIG_MP) += mp.o +obj-$(CONFIG_OF_LIBFDT) += fdt.o +obj-$(CONFIG_SPL) += spl.o + +ifneq ($(CONFIG_FSL_LSCH3),) +obj-y += fsl_lsch3_speed.o +obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch3_serdes.o +endif + +ifneq ($(CONFIG_LS2085A),) +obj-$(CONFIG_SYS_HAS_SERDES) += ls2085a_serdes.o +endif
arch/arm/cpu/armv8/fsl-layerscape/README.lsch3 renamed from arch/arm/cpu/armv8/fsl-lsch3/README +1 -1
@@ -1,5 +1,5 @@ # -# Copyright 2014 Freescale Semiconductor +# Copyright 2014-2015 Freescale Semiconductor # # SPDX-License-Identifier: GPL-2.0+ #
arch/arm/cpu/armv8/fsl-layerscape/cpu.c renamed from arch/arm/cpu/armv8/fsl-lsch3/cpu.c +62 -186
440 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-layerscape/cpu.h renamed from arch/arm/cpu/armv8/fsl-lsch3/cpu.h +1 -1
@@ -1,5 +1,5 @@/* -* Copyright 2014, Freescale Semiconductor +* Copyright 2014-2015, Freescale Semiconductor * * SPDX-License-Identifier: GPL-2.0+ */
arch/arm/cpu/armv8/fsl-layerscape/fdt.c renamed from arch/arm/cpu/armv8/fsl-lsch3/fdt.c +13 -4
@@ -1,5 +1,5 @@/* -* Copyright 2014 Freescale Semiconductor, Inc. +* Copyright 2014-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -7,11 +7,16 @@#include <common.h> #include <libfdt.h> #include <fdt_support.h> -#include <asm/arch-fsl-lsch3/fdt.h> +#include <phy.h> +#ifdef CONFIG_FSL_LSCH3 +#include <asm/arch/fdt.h> +#endif #ifdef CONFIG_FSL_ESDHC #include <fsl_esdhc.h> #endif -#include "mp.h" +#ifdef CONFIG_MP +#include <asm/arch/mp.h> +#endif #ifdef CONFIG_MP void ft_fixup_cpu (void *blob)
@@ -150,6 +155,7 @@ void append_mmu_masters(void *blob, const char *smmu_path,* for all DPAA2 devices. * */ +#ifdef CONFIG_FSL_LSCH3 static void fdt_fixup_smmu (void *blob) {int nodeoffset;
@@ -165,6 +171,7 @@ static void fdt_fixup_smmu(void *blob)fdt_fixup_smmu_pcie (blob); #endif } +#endif void ft_cpu_setup (void *blob,bd_t *bd) {
@@ -181,9 +188,11 @@ void ft_cpu_setup(void *blob, bd_t *bd)ft_pci_setup (blob, bd);#endif -#if defined(CONFIG_FSL_ESDHC ) +#ifdef CONFIG_FSL_ESDHC fdt_fixup_esdhc (blob, bd);#endif +#ifdef CONFIG_FSL_LSCH3 fdt_fixup_smmu (blob); +#endif }
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c renamed from arch/arm/cpu/armv8/fsl-lsch3/fsl_lsch3_serdes.c +4 -4
@@ -1,5 +1,5 @@/* -* Copyright 2015 Freescale Semiconductor, Inc. +* Copyright 2014-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -8,7 +8,7 @@#include <asm/io.h> #include <asm/errno.h> #include <asm/arch/fsl_serdes.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> +#include <asm/arch/soc.h> #include <fsl-mc/ldpaa_wriop.h> #ifdef CONFIG_SYS_FSL_SRDS_1
@@ -35,7 +35,7 @@ int is_serdes_configured(enum srds_prtcl device)int serdes_get_first_lane (u32 sd,enum srds_prtcl device) {struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR ); -u32 cfg =in_le32 (&gur->rcwsr[28 ]); +u32 cfg =gur_in32 (&gur->rcwsr[28 ]);int i;switch (sd) {
@@ -76,7 +76,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); - cfg =in_le32 (&gur->rcwsr[28 ]) & sd_prctl_mask; + cfg =gur_in32 (&gur->rcwsr[28 ]) & sd_prctl_mask; cfg >>= sd_prctl_shift;printf ("Using SERDES%d Protocol: %d (0x%x)\n" , sd +1 , cfg, cfg);
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c renamed from arch/arm/cpu/armv8/fsl-lsch3/speed.c +6 -6
@@ -1,5 +1,5 @@/* -* Copyright 2014, Freescale Semiconductor, Inc. +* Copyright 2014-2015, Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ *
@@ -11,8 +11,8 @@#include <fsl_ifc.h> #include <asm/processor.h> #include <asm/io.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> #include <asm/arch/clock.h> +#include <asm/arch/soc.h> #include "cpu.h" DECLARE_GLOBAL_DATA_PTR ;
@@ -83,15 +83,15 @@ void get_sys_info(struct sys_info *sys_info) sys_info->freq_ddrbus2 = sysclk;#endif - sys_info->freq_systembus *= (in_le32 (&gur->rcwsr[0 ]) >> + sys_info->freq_systembus *= (gur_in32 (&gur->rcwsr[0 ]) >>FSL_CHASSIS3_RCWSR0_SYS_PLL_RAT_SHIFT ) &FSL_CHASSIS3_RCWSR0_SYS_PLL_RAT_MASK ;/* Platform clock is half of platform PLL */ sys_info->freq_systembus /=2 ; - sys_info->freq_ddrbus *= (in_le32 (&gur->rcwsr[0 ]) >> + sys_info->freq_ddrbus *= (gur_in32 (&gur->rcwsr[0 ]) >>FSL_CHASSIS3_RCWSR0_MEM_PLL_RAT_SHIFT ) &FSL_CHASSIS3_RCWSR0_MEM_PLL_RAT_MASK ; - sys_info->freq_ddrbus2 *= (in_le32 (&gur->rcwsr[0 ]) >> + sys_info->freq_ddrbus2 *= (gur_in32 (&gur->rcwsr[0 ]) >>FSL_CHASSIS3_RCWSR0_MEM2_PLL_RAT_SHIFT ) &FSL_CHASSIS3_RCWSR0_MEM2_PLL_RAT_MASK ;
@@ -118,7 +118,7 @@ void get_sys_info(struct sys_info *sys_info) }#if defined(CONFIG_FSL_IFC ) - ccr =in_le32 (&ifc_regs.gregs->ifc_ccr); + ccr =ifc_in32 (&ifc_regs.gregs->ifc_ccr); ccr = ((ccr &IFC_CCR_CLK_DIV_MASK ) >>IFC_CCR_CLK_DIV_SHIFT ) +1 ; sys_info->freq_localbus = sys_info->freq_systembus / ccr;
arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S renamed from arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S +11 -3
@@ -1,5 +1,5 @@ /* - * (C) Copyright 2014 Freescale Semiconductor + * (C) Copyright 2014-2015 Freescale Semiconductor * * SPDX-License-Identifier: GPL-2.0+ *
@@ -10,11 +10,14 @@ #include <linux/linkage.h> #include <asm/gic.h> #include <asm/macro.h> -#include "mp.h" +#ifdef CONFIG_MP +#include <asm/arch/mp.h> +#endif ENTRY(lowlevel_init) mov x29, lr /* Save LR */ +#ifdef CONFIG_FSL_LSCH3 /* Add fully-coherent masters to DVM domain */ ldr x0, =CCI_MN_BASE ldr x1, =CCI_MN_RNF_NODEID_LIST
@@ -81,6 +84,7 @@ ENTRY(lowlevel_init) ldr x0, =CCI_S2_QOS_CONTROL_BASE(20) ldr x1, =0x00FF000C bl ccn504_set_qos +#endif /* Set the SMMU page size in the sACR register */ ldr x1, =SMMU_BASE
@@ -106,10 +110,12 @@ ENTRY(lowlevel_init) branch_if_master x0, x1, 2f +#if defined(CONFIG_MP) && defined(CONFIG_ARMV8_MULTIENTRY) ldr x0, =secondary_boot_func blr x0 -2: +#endif +2: #ifdef CONFIG_FSL_TZPC_BP147 /* Set Non Secure access for all devices protected via TZPC */ ldr x1, =TZPCDECPROT_0_SET_BASE /* Decode Protection-0 Set Reg */
@@ -245,6 +251,7 @@ ENTRY(__asm_flush_l3_cache) ret ENDPROC(__asm_flush_l3_cache) +#ifdef CONFIG_MP /* Keep literals not used by the secondary boot code outside it */ .ltorg
@@ -353,3 +360,4 @@ __real_cntfrq: /* Secondary Boot Code ends here */ __secondary_boot_code_size: .quad .-secondary_boot_code +#endif
arch/arm/cpu/armv8/fsl-layerscape/ls2085a_serdes.c renamed from arch/arm/cpu/armv8/fsl-lsch3/ls2085a_serdes.c +1 -2
@@ -1,12 +1,11 @@/* -* Copyright 2015 Freescale Semiconductor, Inc. +* Copyright 2014-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #include <asm/arch/fsl_serdes.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> struct serdes_config {u8 protocol;
arch/arm/cpu/armv8/fsl-layerscape/mp.c renamed from arch/arm/cpu/armv8/fsl-lsch3/mp.c +8 -8
@@ -1,5 +1,5 @@/* -* Copyright 2014 Freescale Semiconductor, Inc. +* Copyright 2014-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -7,9 +7,8 @@#include <common.h> #include <asm/io.h> #include <asm/system.h> -#include <asm/io.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> -#include "mp.h" +#include <asm/arch/mp.h> +#include <asm/arch/soc.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -23,7 +22,7 @@ phys_addr_t determine_mp_bootpg(void)return (phys_addr_t)&secondary_boot_code; } -int fsl_lsch3_wake_seconday_cores (void ) +int fsl_layerscape_wake_seconday_cores (void ) {struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR );struct ccsr_reset __iomem *rst = (void *)(CONFIG_SYS_FSL_RST_ADDR );
@@ -48,9 +47,10 @@ int fsl_lsch3_wake_seconday_cores(void) (CONFIG_MAX_CPUS*SPIN_TABLE_ELEM_SIZE));printf ("Waking secondary cores to start from %lx\n" , gd->relocaddr); -out_le32 (&gur->bootlocptrh, (u32)(gd->relocaddr >>32 )); -out_le32 (&gur->bootlocptrl, (u32 )gd->relocaddr); -out_le32 (&gur->scratchrw[6 ],1 ); + +gur_out32 (&gur->bootlocptrh, (u32)(gd->relocaddr >>32 )); +gur_out32 (&gur->bootlocptrl, (u32 )gd->relocaddr); +gur_out32 (&gur->scratchrw[6 ],1 ); asmvolatile ("dsb st" : : :"memory" ); rst->brrl = cores; asmvolatile ("dsb st" : : :"memory" );
arch/arm/cpu/armv8/fsl-layerscape/soc.c renamed from arch/arm/cpu/armv8/fsl-lsch3/soc.c +7 -28
@@ -1,19 +1,18 @@/* -* Copyright 2015 Freescale Semiconductor +* Copyright 2014-2015 Freescale Semiconductor * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #include <fsl_ifc.h> -#include <nand.h> -#include <spl.h> -#include <asm/arch-fsl-lsch3/soc.h> +#include <asm/arch/soc.h> #include <asm/io.h> #include <asm/global_data.h> DECLARE_GLOBAL_DATA_PTR ; +#ifdef CONFIG_LS2085A static void erratum_a008751 (void ) {#ifdef CONFIG_SYS_FSL_ERRATUM_A008751
@@ -77,31 +76,11 @@ void fsl_lsch3_early_init_f(void)init_early_memctl_regs ();/* tighten IFC timing */ erratum_a009203(); } +#endif -#ifdef CONFIG_SPL_BUILD -void board_init_f (ulong dummy) -{ -/* Clear global data */ -memset ((void *)gd,0 ,sizeof (gd_t)); - -arch_cpu_init (); -board_early_init_f (); -timer_init (); -env_init (); - gd->baudrate =getenv_ulong ("baudrate" ,10 ,CONFIG_BAUDRATE ); - -serial_init (); -console_init_f (); -dram_init (); - -/* Clear the BSS. */ -memset (__bss_start,0 , __bss_end - __bss_start); - -board_init_r (NULL ,0 ); -} - -u32 spl_boot_device (void ) +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init (void ) { -return BOOT_DEVICE_NAND ; +return 0 ; }#endif
arch/arm/cpu/armv8/fsl-layerscape/spl.c new file +76 -0
76 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-lsch3/Makefile deleted +0 -13
@@ -1,13 +0,0 @@ -# -# Copyright 2014, Freescale Semiconductor -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y += cpu.o -obj-y += lowlevel.o -obj-y += soc.o -obj-y += speed.o -obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch3_serdes.o ls2085a_serdes.o -obj-$(CONFIG_MP) += mp.o -obj-$(CONFIG_OF_LIBFDT) += fdt.o
arch/arm/cpu/armv8/fsl-lsch3/speed.h deleted +0 -7
@@ -1,7 +0,0 @@ -/* -* Copyright 2014, Freescale Semiconductor, Inc. -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -void get_sys_info (struct sys_info *sys_info);
arch/arm/include/asm/arch-fsl-layerscape/clock.h renamed from arch/arm/include/asm/arch-fsl-lsch3/clock.h +4 -4
@@ -1,12 +1,12 @@/* -* Copyright 2014 Freescale Semiconductor, Inc. +* Copyright 2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ * */ -#ifndef __ASM_ARCH_FSL_LSCH3_CLOCK_H_ -#define __ASM_ARCH_FSL_LSCH3_CLOCK_H_ +#ifndef __ASM_ARCH_FSL_LAYERSCAPE_CLOCK_H_ +#define __ASM_ARCH_FSL_LAYERSCAPE_CLOCK_H_#include <common.h>
@@ -21,4 +21,4 @@ enum mxc_clock {unsigned int mxc_get_clock (enum mxc_clock clk); -#endif /* __ASM_ARCH_FSL_LSCH3_CLOCK_H_ */ +#endif /* __ASM_ARCH_FSL_LAYERSCAPE_CLOCK_H_ */
arch/arm/include/asm/arch-fsl-layerscape/config.h new file +96 -0
96 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/cpu.h new file +165 -0
165 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/fdt.h renamed from arch/arm/include/asm/arch-fsl-lsch3/fdt.h +4 -0
@@ -4,7 +4,11 @@* SPDX-License-Identifier: GPL-2.0+ */ +#ifndef _ASM_ARMV8_FSL_LAYERSCAPE_FDT_H_ +#define _ASM_ARMV8_FSL_LAYERSCAPE_FDT_H_ +void alloc_stream_ids (int start_id,int count,u32 *stream_ids,int max_cnt);void append_mmu_masters (void *blob,const char *smmu_path,const char *master_name,u32 *stream_ids,int count);void fdt_fixup_smmu_pcie (void *blob); +#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_FDT_H_ */
arch/arm/include/asm/arch-fsl-layerscape/fsl_serdes.h renamed from arch/arm/include/asm/arch-fsl-lsch3/fsl_serdes.h +5 -6
@@ -4,13 +4,12 @@* SPDX-License-Identifier: GPL-2.0+ */ -#ifndef __FSL_SERDES_H -#define __FSL_SERDES_H +#ifndef __FSL_SERDES_H__ +#define __FSL_SERDES_H__#include <config.h> -#define SRDS_MAX_LANES 8 - +#if defined(CONFIG_LS2085A )enum srds_prtcl {NONE =0 , PCIE1,
@@ -56,12 +55,12 @@ enum srds {FSL_SRDS_1 =0 , FSL_SRDS_2 = 1, }; +#endif int is_serdes_configured (enum srds_prtcl device);void fsl_serdes_init (void ); -int serdes_get_first_lane (u32 sd,enum srds_prtcl device);enum srds_prtcl serdes_get_prtcl (int serdes,int cfg,int lane);int is_serdes_prtcl_valid (int serdes,u32 prtcl); -#endif /* __FSL_SERDES_H */ +#endif /* __FSL_SERDES_H__ */
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h renamed from arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h +102 -17
136 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/imx-regs.h new file +55 -0
55 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/ls2085a_stream_id.h renamed from arch/arm/include/asm/arch-fsl-lsch3/ls2085a_stream_id.h +0 -0
arch/arm/include/asm/arch-fsl-layerscape/mmu.h new file +10 -0
@@ -0,0 +1,10 @@ +/* +* Copyright 2015, Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _ASM_ARMV8_FSL_LAYERSCAPE_MMU_H_ +#define _ASM_ARMV8_FSL_LAYERSCAPE_MMU_H_ +#include <asm/arch-armv8/mmu.h> +#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_MMU_H_ */
arch/arm/include/asm/arch-fsl-layerscape/mp.h renamed from arch/arm/cpu/armv8/fsl-lsch3/mp.h +5 -5
@@ -1,11 +1,11 @@/* -* Copyright 2014, Freescale Semiconductor +* Copyright 2014-2015, Freescale Semiconductor * * SPDX-License-Identifier: GPL-2.0+ */ -#ifndef _FSL_CH3_MP_H -#define _FSL_CH3_MP_H +#ifndef _FSL_LAYERSCAPE_MP_H +#define _FSL_LAYERSCAPE_MP_H/* * Each spin table element is defined as
@@ -29,10 +29,10 @@ extern u64 __spin_table[];extern u64 __real_cntfrq;extern u64 *secondary_boot_code;extern size_t __secondary_boot_code_size; -int fsl_lsch3_wake_seconday_cores (void ); +int fsl_layerscape_wake_seconday_cores (void );void *get_spin_tbl_addr (void );phys_addr_t determine_mp_bootpg (void );void secondary_boot_func (void );int is_core_online (u64 cpu_id);#endif -#endif /* _FSL_CH3_MP_H */ +#endif /* _FSL_LAYERSCAPE_MP_H */
arch/arm/include/asm/arch-fsl-layerscape/soc.h renamed from arch/arm/include/asm/arch-fsl-lsch3/soc.h +20 -1
@@ -4,6 +4,25 @@* SPDX-License-Identifier: GPL-2.0+ */ +#ifndef _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ +#define _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ + +#ifdef CONFIG_SYS_FSL_CCSR_GUR_LE +#define gur_in32(a) in_le32(a) +#define gur_out32(a, v) out_le32(a, v) +#elif defined(CONFIG_SYS_FSL_CCSR_GUR_BE) +#define gur_in32(a) in_be32(a) +#define gur_out32(a, v) out_be32(a, v) +#endif + +#ifdef CONFIG_SYS_FSL_CCSR_SCFG_LE +#define scfg_in32(a) in_le32(a) +#define scfg_out32(a, v) out_le32(a, v) +#elif defined(CONFIG_SYS_FSL_CCSR_SCFG_BE) +#define scfg_in32(a) in_be32(a) +#define scfg_out32(a, v) out_be32(a, v) +#endif + struct cpu_type { char name[15]; u32 soc_ver;
@@ -25,4 +44,4 @@ struct cpu_type {void fsl_lsch3_early_init_f (void );void cpu_name (char *name); - +#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */
arch/arm/include/asm/arch-fsl-layerscape/speed.h new file +10 -0
@@ -0,0 +1,10 @@ +/* +* Copyright 2014-2015, Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _FSL_LAYERSCAPE_SPEED_H +#define _FSL_LAYERSCAPE_SPEED_H +void get_sys_info (struct sys_info *sys_info); +#endif /* _FSL_LAYERSCAPE_SPEED_H */
arch/arm/include/asm/arch-fsl-lsch3/config.h deleted +0 -185
185 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch3/gpio.h deleted +0 -9
@@ -1,9 +0,0 @@ -/* -* Copyright 2014, Freescale Semiconductor -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#ifndef _ASM_ARMV8_FSL_LSCH3_GPIO_H_ -#define _ASM_ARMV8_FSL_LSCH3_GPIO_H_ -#endif /* _ASM_ARMV8_FSL_LSCH3_GPIO_H_ */
arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h deleted +0 -13
@@ -1,13 +0,0 @@ -/* -* Copyright 2014 Freescale Semiconductor, Inc. -* -* SPDX-License-Identifier: GPL-2.0+ -* -*/ - -#ifndef __ASM_ARCH_FSL_LSCH3_IMX_REGS_H_ -#define __ASM_ARCH_FSL_LSCH3_IMX_REGS_H_ - -#define I2C_QUIRK_REG /* enable 8-bit driver */ - -#endif /* __ASM_ARCH_FSL_LSCH3_IMX_REGS_H_ */
arch/arm/include/asm/config.h +2 -5
@@ -15,14 +15,11 @@#define CONFIG_STATIC_RELA #endif -#ifdef CONFIG_FSL_LSCH3 -#include <asm/arch-fsl-lsch3/config.h> -#endif -#if defined(CONFIG_LS102XA ) || \ defined(CONFIG_CPU_PXA27X ) || \ defined(CONFIG_CPU_MONAHANS ) || \ - defined(CONFIG_CPU_PXA25X ) + defined(CONFIG_CPU_PXA25X ) || \ + defined(CONFIG_FSL_LAYERSCAPE )#include <asm/arch/config.h> #endif
board/freescale/ls2085a/Kconfig +2 -2
@@ -7,7 +7,7 @@ config SYS_VENDOR default "freescale" config SYS_SOC - default "fsl-lsch3" + default "fsl-layerscape" config SYS_CONFIG_NAME default "ls2085a_emu"
@@ -23,7 +23,7 @@ config SYS_VENDOR default "freescale" config SYS_SOC - default "fsl-lsch3" + default "fsl-layerscape" config SYS_CONFIG_NAME default "ls2085a_simu"
board/freescale/ls2085a/ls2085a.c +1 -1
@@ -15,7 +15,7 @@#include <fsl_debug_server.h> #include <fsl-mc/fsl_mc.h> #include <environment.h> -#include <asm/arch-fsl-lsch3/soc.h> +#include <asm/arch/soc.h> DECLARE_GLOBAL_DATA_PTR ;
board/freescale/ls2085aqds/Kconfig +1 -1
@@ -8,7 +8,7 @@ config SYS_VENDOR default "freescale" config SYS_SOC - default "fsl-lsch3" + default "fsl-layerscape" config SYS_CONFIG_NAME default "ls2085aqds"
board/freescale/ls2085aqds/eth.c +0 -1
@@ -8,7 +8,6 @@#include <netdev.h> #include <asm/io.h> #include <asm/arch/fsl_serdes.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> #include <hwconfig.h> #include <fsl_mdio.h> #include <malloc.h>
board/freescale/ls2085aqds/ls2085aqds.c +1 -1
@@ -17,7 +17,7 @@#include <environment.h> #include <i2c.h> #include <rtc.h> -#include <asm/arch-fsl-lsch3/soc.h> +#include <asm/arch/soc.h> #include <hwconfig.h> #include "../common/qixis.h"
board/freescale/ls2085ardb/Kconfig +1 -1
@@ -8,7 +8,7 @@ config SYS_VENDOR default "freescale" config SYS_SOC - default "fsl-lsch3" + default "fsl-layerscape" config SYS_CONFIG_NAME default "ls2085ardb"
board/freescale/ls2085ardb/eth_ls2085rdb.c +0 -1
@@ -16,7 +16,6 @@#include <asm/io.h> #include <exports.h> #include <asm/arch/fsl_serdes.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> #include <fsl-mc/ldpaa_wriop.h> DECLARE_GLOBAL_DATA_PTR ;
board/freescale/ls2085ardb/ls2085ardb.c +1 -1
@@ -17,7 +17,7 @@#include <fsl-mc/fsl_mc.h> #include <environment.h> #include <i2c.h> -#include <asm/arch-fsl-lsch3/soc.h> +#include <asm/arch/soc.h> #include "../common/qixis.h" #include "ls2085ardb_qixis.h"
drivers/i2c/mxc_i2c.c +2 -2
@@ -523,8 +523,8 @@ static int bus_i2c_write(struct mxc_i2c_bus *i2c_bus, u8 chip, u32 addr,#endif static struct mxc_i2c_bus mxc_i2c_buses[] = { -#if defined(CONFIG_LS102XA ) || defined(CONFIG_FSL_LSCH3 ) || \ - defined(CONFIG_VF610 ) +#if defined(CONFIG_LS102XA ) || defined(CONFIG_VF610 ) || \ + defined(CONFIG_FSL_LAYERSCAPE ) { 0, I2C1_BASE_ADDR, I2C_QUIRK_FLAG }, { 1, I2C2_BASE_ADDR, I2C_QUIRK_FLAG }, { 2, I2C3_BASE_ADDR, I2C_QUIRK_FLAG },
drivers/misc/fsl_debug_server.c +0 -1
@@ -8,7 +8,6 @@#include <errno.h> #include <asm/io.h> #include <asm/system.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> #include <fsl-mc/fsl_mc.h> #include <fsl_debug_server.h>
drivers/net/ldpaa_eth/ls2085a.c +0 -2
@@ -7,9 +7,7 @@#include <phy.h> #include <fsl-mc/ldpaa_wriop.h> #include <asm/io.h> -#include <asm/arch-fsl-lsch3/immap_lsch3.h> #include <asm/arch/fsl_serdes.h> -#include <fsl-mc/ldpaa_wriop.h> u32 dpmac_to_devdisr[] = { [WRIOP1_DPMAC1 ] =FSL_CHASSIS3_DEVDISR2_DPMAC1 ,
drivers/pci/pcie_layerscape.c +3 -1
@@ -11,7 +11,9 @@#include <asm/io.h> #include <errno.h> #include <malloc.h> -#include <asm/arch-fsl-lsch3/fdt.h> +#ifdef CONFIG_FSL_LAYERSCAPE +#include <asm/arch/fdt.h> +#endif #ifndef CONFIG_SYS_PCI_MEMORY_BUS #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE
include/common.h +3 -0
@@ -76,6 +76,9 @@ typedef volatile unsigned char vu_char;#ifdef CONFIG_SOC_DA8XX #include <asm/arch/hardware.h> #endif +#ifdef CONFIG_FSL_LSCH3 +#include <asm/arch/immap_lsch3.h> +#endif #include <part.h> #include <flash.h>
include/configs/ls2085a_common.h +8 -2
@@ -9,8 +9,10 @@#define CONFIG_REMAKE_ELF +#define CONFIG_FSL_LAYERSCAPE #define CONFIG_FSL_LSCH3 #define CONFIG_LS2085A +#define CONFIG_MP #define CONFIG_GICV3 #define CONFIG_FSL_TZPC_BP147
@@ -18,12 +20,15 @@#define CONFIG_ARM_ERRATA_828024 #define CONFIG_ARM_ERRATA_826974 -#include <asm/arch-fsl-lsch3/ls2085a_stream_id.h> -#include <asm/arch-fsl-lsch3/config.h> +#include <asm/arch/ls2085a_stream_id.h> +#include <asm/arch/config.h> #if (defined(CONFIG_SYS_FSL_SRDS_1 ) || defined(CONFIG_SYS_FSL_SRDS_2 ))#define CONFIG_SYS_HAS_SERDES #endif +/* Link Definitions */ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_FSL_OCRAM_BASE + 0xfff0) +/* We need architecture specific misc initializations */ #define CONFIG_ARCH_MISC_INIT
@@ -61,6 +66,7 @@#define CONFIG_SYS_FSL_DDR_INTLV_256B /* force 256 byte interleaving */ +#define CONFIG_VERY_BIG_RAM #define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000UL#define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 11/17 armv8/fsl_lsch2: Add fsl_lsch2 SoC
In reply to Gong QianyuFrom: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with ARMv8 cores and 2rd generation of Chassis.
---
V8:
- No changes.
V7:
- No change.
V6:
- Remove GIC SMMU macros back to config.h.
V5:
- Move LS1043A ddr macros out of soc #ifdef.
- Move macros and structs from cpu.c to cpu.h.
- Wrap le32 and be32 functions for ccsr gur and scfg. Defined in soc.h
- Modify fsl-layerscape/Makefile.
V4:
- Add fsl_lsch2 to fsl-layerscape framework.
V3:
- Update MMU table initialization to match the latest code.
- Remove some dead code
- Rename #include<asm/arch-fsl-lsch2/xxx> to #include<asm/arch/xxx>
V2:
- remove FSL_LS102xA_DEVDISR3_PCIE from immap_lsch2.h
arch/arm/cpu/armv8/fsl-layerscape/Makefile | 5 + arch/arm/cpu/armv8/fsl-layerscape/README.lsch2 | 10 + arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 13 + .../cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c | 117 +++++ .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c | 137 +++++ arch/arm/cpu/armv8/fsl-layerscape/soc.c | 17 + arch/arm/include/asm/arch-fsl-layerscape/config.h | 47 ++ arch/arm/include/asm/arch-fsl-layerscape/cpu.h | 64 +++ .../include/asm/arch-fsl-layerscape/fsl_serdes.h | 91 ++++ .../include/asm/arch-fsl-layerscape/immap_lsch2.h | 555 +++++++++++++++++++++ .../include/asm/arch-fsl-layerscape/ns_access.h | 158 ++++++ arch/arm/include/asm/arch-fsl-layerscape/soc.h | 6 + arch/arm/include/asm/armv8/mmu.h | 1 + include/common.h | 3 + 14 files changed, 1224 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/Makefile +5 -0
@@ -14,6 +14,11 @@ obj-$(CONFIG_SPL) += spl.o ifneq ($(CONFIG_FSL_LSCH3),) obj-y += fsl_lsch3_speed.o obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch3_serdes.o +else +ifneq ($(CONFIG_FSL_LSCH2),) +obj-y += fsl_lsch2_speed.o +obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch2_serdes.o +endif endif ifneq ($(CONFIG_LS2085A),)
arch/arm/cpu/armv8/fsl-layerscape/README.lsch2 new file +10 -0
@@ -0,0 +1,10 @@ +# +# Copyright 2015 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +Freescale LayerScape with Chassis Generation 2 + +This architecture supports Freescale ARMv8 SoCs with Chassis generation 2, +for example LS1043A.
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +13 -0
@@ -180,6 +180,8 @@ static inline void early_mmu_setup(void)set_pgtable_table (level1_table0,CONFIG_SYS_FLASH_BASE >>SECTION_SHIFT_L1 , level2_table1); +#elif defined(CONFIG_FSL_LSCH2 ) +set_pgtable_table (level1_table0,1 , level2_table1);#endif /* Find the table and fill in the block entries */ for (i =0 ; i <ARRAY_SIZE (early_mmu_table); i++) {
@@ -215,6 +217,9 @@ static inline void early_mmu_setup(void)* * For LSCH3: * Level 2 table 1 contains 512 entries for each 2MB from 32GB to 33GB. +* For LSCH2: +* Level 2 table 1 contains 512 entries for each 2MB from 1GB to 2GB. +* Level 2 table 2 contains 512 entries for each 2MB from 20GB to 21GB. */ static inline void final_mmu_setup (void ) {
@@ -225,6 +230,9 @@ static inline void final_mmu_setup(void)u64 *level2_table0 = (u64 *)(gd->arch.tlb_addr +0x3000 );#ifdef CONFIG_FSL_LSCH3 u64 *level2_table1 = (u64 *)(gd->arch.tlb_addr +0x4000 ); +#elif defined(CONFIG_FSL_LSCH2 ) +u64 *level2_table1 = (u64 *)(gd->arch.tlb_addr +0x4000 ); +u64 *level2_table2 = (u64 *)(gd->arch.tlb_addr +0x5000 );#endif struct table_info table = {level0_table,0 ,BLOCK_SIZE_L0 };
@@ -239,6 +247,11 @@ static inline void final_mmu_setup(void)set_pgtable_table (level1_table0,CONFIG_SYS_FSL_QBMAN_BASE >>SECTION_SHIFT_L1 , level2_table1); +#elif defined(CONFIG_FSL_LSCH2 ) +set_pgtable_table (level1_table0,1 , level2_table1); +set_pgtable_table (level1_table0, +CONFIG_SYS_FSL_QBMAN_BASE >>SECTION_SHIFT_L1 , + level2_table2);#endif /* Find the table and fill in the block entries */
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c new file +117 -0
117 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c new file +137 -0
137 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-layerscape/soc.c +17 -0
@@ -76,6 +76,23 @@ void fsl_lsch3_early_init_f(void)init_early_memctl_regs ();/* tighten IFC timing */ erratum_a009203(); } + +#elif defined(CONFIG_LS1043A) +void fsl_lsch2_early_init_f (void ) +{ +struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR ; + +#ifdef CONFIG_FSL_IFC +init_early_memctl_regs ();/* tighten IFC timing */ +#endif + +/* +* Enable snoop requests and DVM message requests for +* Slave insterface S4 (A53 core cluster) +*/ +out_le32 (&cci->slave[4 ].snoop_ctrl, +CCI400_DVM_MESSAGE_REQ_EN |CCI400_SNOOP_REQ_EN ); +}#endif #ifdef CONFIG_BOARD_LATE_INIT
arch/arm/include/asm/arch-fsl-layerscape/config.h +47 -0
53 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/cpu.h +64 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/fsl_serdes.h +91 -0
101 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h new file +555 -0
555 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/ns_access.h new file +158 -0
158 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-layerscape/soc.h +6 -0
@@ -33,6 +33,7 @@ struct cpu_type { { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc)}#define SVR_WO_E 0xFFFFFE +#define SVR_LS1043 0x879204#define SVR_LS2045 0x870120#define SVR_LS2080 0x870110#define SVR_LS2085 0x870100
@@ -42,6 +43,11 @@ struct cpu_type {#define SVR_SOC_VER (svr) (((svr) >> 8) & SVR_WO_E)#define IS_E_PROCESSOR (svr) (!((svr >> 8) & 0x1)) +#ifdef CONFIG_FSL_LSCH3 void fsl_lsch3_early_init_f (void ); +#elif defined(CONFIG_FSL_LSCH2 ) +void fsl_lsch2_early_init_f (void ); +#endif +void cpu_name (char *name);#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */
arch/arm/include/asm/armv8/mmu.h +1 -0
@@ -65,6 +65,7 @@/* * Section */ +#define PMD_SECT_NS (1 << 5)#define PMD_SECT_NON_SHARE (0 << 8)#define PMD_SECT_OUTER_SHARE (2 << 8)#define PMD_SECT_INNER_SHARE (3 << 8)
include/common.h +3 -0
@@ -79,6 +79,9 @@ typedef volatile unsigned char vu_char;#ifdef CONFIG_FSL_LSCH3 #include <asm/arch/immap_lsch3.h> #endif +#ifdef CONFIG_FSL_LSCH2 +#include <asm/arch/immap_lsch2.h> +#endif #include <part.h> #include <flash.h>
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 12/17 armv8/ls1043ardb: Add LS1043ARDB board support
In reply to Gong QianyuFrom: Mingkai Hu <[email protected]>
LS1043ARDB Specification:
-------------------------
Memory subsystem:
* 2GByte DDR4 SDRAM (32bit bus)
* 128 Mbyte NOR flash single-chip memory
* 512 Mbyte NAND flash
* 16 Mbyte high-speed SPI flash
* SD connector to interface with the SD memory card
Ethernet:
* XFI 10G port
* QSGMII with 4x 1G ports
* Two RGMII ports
PCIe:
* PCIe2 (Lanes C) to mini-PCIe slot
* PCIe3 (Lanes D) to PCIe slot
USB 3.0: two super speed USB 3.0 type A ports
UART: supports two UARTs up to 115200 bps for console
---
V8:
- No changes.
V7:
- No change.
V6:
- Move GIC SMMU macros out of ls1043a_common.h.
V5:
- No change.
V4:
- Change arch to layerscape.
- Add PCIe support.
- Move SMMU_BASE, GICC_BASE, GICD_BASE to ls1043a_common.h.
V3:
- Fix message typos.
- Add ddr model number in comments.
- Fix boot options in README.
- Remove some dead code.
V2:
- Replaced ns_access.h with fsl_csu.h.
arch/arm/Kconfig | 7 + arch/arm/cpu/armv8/fsl-layerscape/Makefile | 4 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_serdes.c | 86 ++++++++++ board/freescale/ls1043ardb/Kconfig | 16 ++ board/freescale/ls1043ardb/MAINTAINERS | 7 + board/freescale/ls1043ardb/Makefile | 9 + board/freescale/ls1043ardb/README | 85 +++++++++ board/freescale/ls1043ardb/cpld.c | 115 +++++++++++++ board/freescale/ls1043ardb/cpld.h | 43 +++++ board/freescale/ls1043ardb/ddr.c | 191 +++++++++++++++++++++ board/freescale/ls1043ardb/ddr.h | 45 +++++ board/freescale/ls1043ardb/ls1043ardb.c | 131 ++++++++++++++ configs/ls1043ardb_defconfig | 4 + include/configs/ls1043a_common.h | 172 +++++++++++++++++++ include/configs/ls1043ardb.h | 191 +++++++++++++++++++++ 15 files changed, 1106 insertions(+)
arch/arm/Kconfig +7 -0
@@ -627,6 +627,12 @@ config TARGET_LS1021ATWR select CPU_V7 select SUPPORT_SPL +config TARGET_LS1043ARDB + bool "Support ls1043ardb" + select ARM64 + help + Support for Freescale LS1043ARDB platform. + config TARGET_H2200 bool "Support h2200" select CPU_PXA
@@ -743,6 +749,7 @@ source "board/freescale/ls2085aqds/Kconfig" source "board/freescale/ls2085ardb/Kconfig" source "board/freescale/ls1021aqds/Kconfig" source "board/freescale/ls1021atwr/Kconfig" +source "board/freescale/ls1043ardb/Kconfig" source "board/freescale/mx23evk/Kconfig" source "board/freescale/mx25pdk/Kconfig" source "board/freescale/mx28evk/Kconfig"
arch/arm/cpu/armv8/fsl-layerscape/Makefile +4 -0
@@ -23,4 +23,8 @@ endif ifneq ($(CONFIG_LS2085A),) obj-$(CONFIG_SYS_HAS_SERDES) += ls2085a_serdes.o +else +ifneq ($(CONFIG_LS1043A),) +obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o +endif endif
arch/arm/cpu/armv8/fsl-layerscape/ls1043a_serdes.c new file +86 -0
86 lines not on this page · raw message
board/freescale/ls1043ardb/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ + +if TARGET_LS1043ARDB + +config SYS_BOARD + default "ls1043ardb" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "fsl-layerscape" + +config SYS_CONFIG_NAME + default "ls1043ardb" + +endif
board/freescale/ls1043ardb/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +LS1043A BOARD +M: Mingkai Hu <[email protected]> +S: Maintained +F: board/freescale/ls1043ardb/ +F: board/freescale/ls1043ardb/ls1043ardb.c +F: include/configs/ls1043ardb.h +F: configs/ls1043ardb_defconfig
board/freescale/ls1043ardb/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# Copyright 2015 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpld.o +obj-y += ddr.o +obj-y += ls1043ardb.o
board/freescale/ls1043ardb/README new file +85 -0
85 lines not on this page · raw message
board/freescale/ls1043ardb/cpld.c new file +115 -0
115 lines not on this page · raw message
board/freescale/ls1043ardb/cpld.h new file +43 -0
43 lines not on this page · raw message
board/freescale/ls1043ardb/ddr.c new file +191 -0
191 lines not on this page · raw message
board/freescale/ls1043ardb/ddr.h new file +45 -0
45 lines not on this page · raw message
board/freescale/ls1043ardb/ls1043ardb.c new file +131 -0
131 lines not on this page · raw message
configs/ls1043ardb_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043ARDB=y +CONFIG_FSL_LAYERSCAPE=y
include/configs/ls1043a_common.h new file +172 -0
172 lines not on this page · raw message
include/configs/ls1043ardb.h new file +191 -0
191 lines not on this page · raw message
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 12/17 armv8/ls1043ardb: Add LS1043ARDB board support
Quoted 66 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
LS1043ARDB Specification:
-------------------------
Memory subsystem:
* 2GByte DDR4 SDRAM (32bit bus)
* 128 Mbyte NOR flash single-chip memory
* 512 Mbyte NAND flash
* 16 Mbyte high-speed SPI flash
* SD connector to interface with the SD memory cardEthernet:
* XFI 10G port
* QSGMII with 4x 1G ports
* Two RGMII portsPCIe:
* PCIe2 (Lanes C) to mini-PCIe slot
* PCIe3 (Lanes D) to PCIe slotUSB 3.0: two super speed USB 3.0 type A ports
UART: supports two UARTs up to 115200 bps for console
Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Li Yang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by York Sun <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V8:
- No changes.
V7:
- No change.
V6:
- Move GIC SMMU macros out ofls1043a_common.h.
V5:
- No change.
V4:
- Change arch to layerscape.
- Add PCIe support.
- MoveSMMU_BASE,GICC_BASE,GICD_BASEtols1043a_common.h.
V3:
- Fix message typos.
- Add ddr model number in comments.
- Fix boot options in README.
- Remove some dead code.
V2:
- Replacedns_access.hwithfsl_csu.h.arch/arm/Kconfig | 7 + arch/arm/cpu/armv8/fsl-layerscape/Makefile | 4 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_serdes.c | 86 ++++++++++ board/freescale/ls1043ardb/Kconfig | 16 ++ board/freescale/ls1043ardb/MAINTAINERS | 7 + board/freescale/ls1043ardb/Makefile | 9 + board/freescale/ls1043ardb/README | 85 +++++++++ board/freescale/ls1043ardb/cpld.c | 115 +++++++++++++ board/freescale/ls1043ardb/cpld.h | 43 +++++ board/freescale/ls1043ardb/ddr.c | 191 +++++++++++++++++++++ board/freescale/ls1043ardb/ddr.h | 45 +++++ board/freescale/ls1043ardb/ls1043ardb.c | 131 ++++++++++++++ configs/ls1043ardb_defconfig | 4 + include/configs/ls1043a_common.h | 172 +++++++++++++++++++ include/configs/ls1043ardb.h | 191 +++++++++++++++++++++ 15 files changed, 1106 insertions(+)
<snip>
Quoted 187 lines
board/freescale/ls1043ardb/ddr.c new file +181
-0@@ -0,0 +1,191 @@ +/* +* Copyright 2015 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <fsl_ddr_sdram.h> +#include <fsl_ddr_dimm_params.h> +#include "ddr.h" +#ifdef CONFIG_FSL_DEEP_SLEEP +#include <fsl_sleep.h> +#endif + +DECLARE_GLOBAL_DATA_PTR ; + +void fsl_ddr_board_options (memctl_options_t *popts, +dimm_params_t *pdimm, +unsigned int ctrl_num) +{ +const struct board_specific_parameters *pbsp, *pbsp_highest =NULL ; +ulong ddr_freq; + +if (ctrl_num >1 ) { +printf ("Not supported controller number %d\n" , ctrl_num); +return ; + } +if (!pdimm->n_ranks) +return ; + + pbsp = udimms[0 ]; + +/* Get clk_adjust, wrlvl_start, wrlvl_ctl, according to the board ddr +* freqency and n_banks specified in board_specific_parameters table. +*/ + ddr_freq =get_ddr_freq (0 ) /1000000 ; +while (pbsp->datarate_mhz_high) { +if (pbsp->n_ranks == pdimm->n_ranks) { +if (ddr_freq <= pbsp->datarate_mhz_high) { + popts->clk_adjust = pbsp->clk_adjust; + popts->wrlvl_start = pbsp->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + popts->cpo_override = pbsp->cpo_override; + popts->write_data_delay = + pbsp->write_data_delay; + goto found; + } + pbsp_highest = pbsp; + } + pbsp++; + } + +if (pbsp_highest) { +printf ("Error: board specific timing not found for %lu MT/s\n" , + ddr_freq); +printf ("Trying to use the highest speed (%u) parameters\n" , + pbsp_highest->datarate_mhz_high); + popts->clk_adjust = pbsp_highest->clk_adjust; + popts->wrlvl_start = pbsp_highest->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + }else { +panic ("DIMM is not supported by this board" ); + } +found: +debug ("Found timing match: n_ranks %d, data rate %d, rank_gb %d\n" , + pbsp->n_ranks, pbsp->datarate_mhz_high, pbsp->rank_gb); + +/* force DDR bus width to 32 bits */ + popts->data_bus_width =1 ; + popts->otf_burst_chop_en =0 ; + popts->burst_length =DDR_BL8 ; + +/* +* Factors to consider for half-strength driver enable: +* - number of DIMMs installed +*/ + popts->half_strength_driver_enable =1 ; +/* +* Write leveling override +*/ + popts->wrlvl_override =1 ; + popts->wrlvl_sample =0xf ; + +/* +* Rtt and Rtt_WR override +*/ + popts->rtt_override =0 ; + +/* Enable ZQ calibration */ + popts->zq_en =1 ; + + popts->ddr_cdr1 =DDR_CDR1_DHC_EN |DDR_CDR1_ODT (DDR_CDR_ODT_80ohm); + popts->ddr_cdr2 =DDR_CDR2_ODT (DDR_CDR_ODT_80ohm) | +DDR_CDR2_VREF_OVRD (70 );/* Vref = 70% */ +} + +/* DDR model number: MT40A512M8HX-093E */ +#ifdef CONFIG_SYS_DDR_RAW_TIMING +dimm_params_t ddr_raw_timing = { + .n_ranks =1 , + .rank_density =2147483648u , + .capacity =2147483648u , + .primary_sdram_width =32 , + .ec_sdram_width =0 , + .registered_dimm =0 , + .mirrored_dimm =0 , + .n_row_addr =15 , + .n_col_addr =10 , + .bank_addr_bits =0 , + .bank_group_bits =2 , + .edc_config =0 , + .burst_lengths_bitmask =0x0c , + + .tckmin_x_ps =938 , + .tckmax_ps =1500 , + .caslat_x =0x000DFA00 , + .taa_ps =13500 , + .trcd_ps =13500 , + .trp_ps =13500 , + .tras_ps =33000 , + .trc_ps =46500 , + .trfc1_ps =260000 , + .trfc2_ps =160000 , + .trfc4_ps =110000 , + .tfaw_ps =21000 , + .trrds_ps =3700 , + .trrdl_ps =5300 , + .tccdl_ps =5355 , + .refresh_rate_ps =7800000 , + .dq_mapping[0 ] =0x0 , + .dq_mapping[1 ] =0x0 , + .dq_mapping[2 ] =0x0 , + .dq_mapping[3 ] =0x0 , + .dq_mapping[4 ] =0x0 , + .dq_mapping[5 ] =0x0 , + .dq_mapping[6 ] =0x0 , + .dq_mapping[7 ] =0x0 , + .dq_mapping[8 ] =0x0 , + .dq_mapping[9 ] =0x0 , + .dq_mapping[10 ] =0x0 , + .dq_mapping[11 ] =0x0 , + .dq_mapping[12 ] =0x0 , + .dq_mapping[13 ] =0x0 , + .dq_mapping[14 ] =0x0 , + .dq_mapping[15 ] =0x0 , + .dq_mapping[16 ] =0x0 , + .dq_mapping[17 ] =0x0 , + .dq_mapping_ors =0 , +}; + +int fsl_ddr_get_dimm_params (dimm_params_t *pdimm, +unsigned int controller_number, +unsigned int dimm_number) +{ +static const char dimm_model[] ="Fixed DDR on board" ; + +if (((controller_number ==0 ) && (dimm_number ==0 )) || + ((controller_number ==1 ) && (dimm_number ==0 ))) { +memcpy (pdimm, &ddr_raw_timing,sizeof (dimm_params_t)); +memset (pdimm->mpart,0 ,sizeof (pdimm->mpart)); +memcpy (pdimm->mpart, dimm_model,sizeof (dimm_model) -1 ); + } + +return 0 ; +} +#endif + +phys_size_t initdram (int board_type) +{ +phys_size_t dram_size; + +#if defined(CONFIG_SPL_BUILD ) || !defined(CONFIG_SPL ) +puts ("Initializing DDR....\n" ); + dram_size =fsl_ddr_sdram (); +#else + dram_size =fsl_ddr_sdram_size (); +#endif +#ifdef CONFIG_FSL_DEEP_SLEEP +fsl_dp_ddr_restore ();
board/freescale/ls1043ardb/ddr.c line 191
Quoted 10 lines
board/freescale/ls1043ardb/ddr.c new file +10
-0+#endif + +return dram_size; +} + +void dram_init_banksize (void ) +{ + gd->bd->bi_dram[0 ].start =CONFIG_SYS_SDRAM_BASE ; + gd->bd->bi_dram[0 ].size = gd->ram_size; +}
Mingkai,
There is an issue with this function. If you have large memory, you will have more than one bank, won't you?
York
PATCH v8 12/17 armv8/ls1043ardb: Add LS1043ARDB board support
Quoted 294 lines
-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Saturday, November 07, 2015 4:11 AM
To: Gong Qianyu-B52263; u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Xie Shaohui-B21989; Song Wenbin-B53747; Wood Scott-B07421; Kushwaha Prabhakar-B32579; Wang Huan-B18965; Li Yang-Leo-R58472
Subject: Re: [Patch V8 12/17] armv8/ls1043ardb: Add LS1043ARDB board supportQuoted 50 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
LS1043ARDB Specification:
-------------------------
Memory subsystem:
* 2GByte DDR4 SDRAM (32bit bus)
* 128 Mbyte NOR flash single-chip memory
* 512 Mbyte NAND flash
* 16 Mbyte high-speed SPI flash
* SD connector to interface with the SD memory cardEthernet:
* XFI 10G port
* QSGMII with 4x 1G ports
* Two RGMII portsPCIe:
* PCIe2 (Lanes C) to mini-PCIe slot
* PCIe3 (Lanes D) to PCIe slotUSB 3.0: two super speed USB 3.0 type A ports
UART: supports two UARTs up to 115200 bps for console
Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Li Yang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by York Sun <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V8:
- No changes.
V7:
- No change.
V6:
- Move GIC SMMU macros out ofls1043a_common.h.
V5:
- No change.
V4:
- Change arch to layerscape.
- Add PCIe support.
- MoveSMMU_BASE,GICC_BASE,GICD_BASEtols1043a_common.h.
V3:
- Fix message typos.
- Add ddr model number in comments.
- Fix boot options in README.
- Remove some dead code.
V2:
- Replacedns_access.hwithfsl_csu.h.Quoted 8 lines
arch/arm/Kconfig | 7 + arch/arm/cpu/armv8/fsl-layerscape/Makefile | 4 + arch/arm/cpu/armv8/fsl-layerscape/ls1043a_serdes.c | 86 ++++++++++ board/freescale/ls1043ardb/Kconfig | 16 ++ board/freescale/ls1043ardb/MAINTAINERS | 7 + board/freescale/ls1043ardb/Makefile | 9 + board/freescale/ls1043ardb/README | 85 +++++++++ board/freescale/ls1043ardb/cpld.c | 115+++++++++++++
Quoted 2 lines
board/freescale/ls1043ardb/cpld.h | 43 +++++ board/freescale/ls1043ardb/ddr.c | 191+++++++++++++++++++++
Quoted 2 lines
board/freescale/ls1043ardb/ddr.h | 45 +++++ board/freescale/ls1043ardb/ls1043ardb.c | 131++++++++++++++
Quoted 2 lines
configs/ls1043ardb_defconfig | 4 + include/configs/ls1043a_common.h | 172+++++++++++++++++++
Quoted 1 line
include/configs/ls1043ardb.h | 191+++++++++++++++++++++
Quoted 1 line
15 files changed, 1106 insertions(+)<snip>
Quoted 18 lines
board/freescale/ls1043ardb/ddr.c new file +11
-0@@ -0,0 +1,191 @@ +/* +* Copyright 2015 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <fsl_ddr_sdram.h> +#include <fsl_ddr_dimm_params.h> +#include "ddr.h" +#ifdef CONFIG_FSL_DEEP_SLEEP board/freescale/ls1043ardb/ddr.c line 21
Quoted 10 lines
board/freescale/ls1043ardb/ddr.c new file +10
-0+#include <fsl_sleep.h> +#endif + +DECLARE_GLOBAL_DATA_PTR ; + +void fsl_ddr_board_options (memctl_options_t *popts, +dimm_params_t *pdimm, +unsigned int ctrl_num) +{ + const struct board_specific_parameters *pbsp, *pbsp_highest =NULL;
board/freescale/ls1043ardb/ddr.c
Quoted 12 lines
board/freescale/ls1043ardb/ddr.c new file +12
-0+ulong ddr_freq; + +if (ctrl_num >1 ) { +printf ("Not supported controller number %d\n" , ctrl_num); +return ; + } +if (!pdimm->n_ranks) +return ; + + pbsp = udimms[0 ]; + +/* Get clk_adjust, wrlvl_start, wrlvl_ctl, according to the board ddr
board/freescale/ls1043ardb/ddr.c line 34
Quoted 1 line
board/freescale/ls1043ardb/ddr.c new file +1
-0+* freqency and n_banks specified in board_specific_parameters table.
Quoted 11 lines
board/freescale/ls1043ardb/ddr.c new file +11
-0+*/ + ddr_freq =get_ddr_freq (0 ) /1000000 ; +while (pbsp->datarate_mhz_high) { +if (pbsp->n_ranks == pdimm->n_ranks) { +if (ddr_freq <= pbsp->datarate_mhz_high) { + popts->clk_adjust = pbsp->clk_adjust; + popts->wrlvl_start = pbsp->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + popts->cpo_override = pbsp->cpo_override; + popts->write_data_delay =board/freescale/ls1043ardb/ddr.c
Quoted 10 lines
board/freescale/ls1043ardb/ddr.c new file +10
-0+ pbsp->write_data_delay; + goto found; + } + pbsp_highest = pbsp; + } + pbsp++; + } + +if (pbsp_highest) { + printf("Error: board specific timing not found for %luMT/s\n",
board/freescale/ls1043ardb/ddr.c
Quoted 12 lines
board/freescale/ls1043ardb/ddr.c new file +12
-0+ ddr_freq); +printf ("Trying to use the highest speed (%u) parameters\n" , + pbsp_highest->datarate_mhz_high); + popts->clk_adjust = pbsp_highest->clk_adjust; + popts->wrlvl_start = pbsp_highest->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + }else { +panic ("DIMM is not supported by this board" ); + } +found: + debug("Found timing match: n_ranks %d, data rate %d,
rank_gb%d\n",Quoted 17 lines
board/freescale/ls1043ardb/ddr.c new file +17
-0+ pbsp->n_ranks, pbsp->datarate_mhz_high, pbsp->rank_gb); + +/* force DDR bus width to 32 bits */ + popts->data_bus_width =1 ; + popts->otf_burst_chop_en =0 ; + popts->burst_length =DDR_BL8 ; + +/* +* Factors to consider for half-strength driver enable: +* - number of DIMMs installed +*/ + popts->half_strength_driver_enable =1 ; +/* +* Write leveling override +*/ + popts->wrlvl_override =1 ; + popts->wrlvl_sample =0xf ;board/freescale/ls1043ardb/ddr.c
Quoted 10 lines
board/freescale/ls1043ardb/ddr.c new file +10
-0+ +/* +* Rtt and Rtt_WR override +*/ + popts->rtt_override =0 ; + +/* Enable ZQ calibration */ + popts->zq_en =1 ; + + popts->ddr_cdr1 = DDR_CDR1_DHC_EN |
DDR_CDR1_ODT(DDR_CDR_ODT_80ohm);Quoted 85 lines
board/freescale/ls1043ardb/ddr.c new file +85
-0+ popts->ddr_cdr2 =DDR_CDR2_ODT (DDR_CDR_ODT_80ohm) | + DDR_CDR2_VREF_OVRD(70); /* Vref = 70% */ +} + +/* DDR model number: MT40A512M8HX-093E */ #ifdef +CONFIG_SYS_DDR_RAW_TIMING dimm_params_t ddr_raw_timing = { + .n_ranks =1 , + .rank_density =2147483648u , + .capacity =2147483648u , + .primary_sdram_width =32 , + .ec_sdram_width =0 , + .registered_dimm =0 , + .mirrored_dimm =0 , + .n_row_addr =15 , + .n_col_addr =10 , + .bank_addr_bits =0 , + .bank_group_bits =2 , + .edc_config =0 , + .burst_lengths_bitmask =0x0c , + + .tckmin_x_ps =938 , + .tckmax_ps =1500 , + .caslat_x =0x000DFA00 , + .taa_ps =13500 , + .trcd_ps =13500 , + .trp_ps =13500 , + .tras_ps =33000 , + .trc_ps =46500 , + .trfc1_ps =260000 , + .trfc2_ps =160000 , + .trfc4_ps =110000 , + .tfaw_ps =21000 , + .trrds_ps =3700 , + .trrdl_ps =5300 , + .tccdl_ps =5355 , + .refresh_rate_ps =7800000 , + .dq_mapping[0 ] =0x0 , + .dq_mapping[1 ] =0x0 , + .dq_mapping[2 ] =0x0 , + .dq_mapping[3 ] =0x0 , + .dq_mapping[4 ] =0x0 , + .dq_mapping[5 ] =0x0 , + .dq_mapping[6 ] =0x0 , + .dq_mapping[7 ] =0x0 , + .dq_mapping[8 ] =0x0 , + .dq_mapping[9 ] =0x0 , + .dq_mapping[10 ] =0x0 , + .dq_mapping[11 ] =0x0 , + .dq_mapping[12 ] =0x0 , + .dq_mapping[13 ] =0x0 , + .dq_mapping[14 ] =0x0 , + .dq_mapping[15 ] =0x0 , + .dq_mapping[16 ] =0x0 , + .dq_mapping[17 ] =0x0 , + .dq_mapping_ors =0 , +}; + +int fsl_ddr_get_dimm_params (dimm_params_t *pdimm, +unsigned int controller_number, +unsigned int dimm_number) +{ +static const char dimm_model[] ="Fixed DDR on board" ; + +if (((controller_number ==0 ) && (dimm_number ==0 )) || + ((controller_number ==1 ) && (dimm_number ==0 ))) { +memcpy (pdimm, &ddr_raw_timing,sizeof (dimm_params_t)); +memset (pdimm->mpart,0 ,sizeof (pdimm->mpart)); +memcpy (pdimm->mpart, dimm_model,sizeof (dimm_model) -1 ); + } + +return 0 ; +} +#endif + +phys_size_t initdram (int board_type) +{ +phys_size_t dram_size; + +#if defined(CONFIG_SPL_BUILD ) || !defined(CONFIG_SPL ) +puts ("Initializing DDR....\n" ); + dram_size =fsl_ddr_sdram (); +#else + dram_size =fsl_ddr_sdram_size (); +#endif +#ifdef CONFIG_FSL_DEEP_SLEEP board/freescale/ls1043ardb/ddr.c
Quoted 10 lines
board/freescale/ls1043ardb/ddr.c new file +10
-0+fsl_dp_ddr_restore (); +#endif + +return dram_size; +} + +void dram_init_banksize (void ) +{ + gd->bd->bi_dram[0 ].start =CONFIG_SYS_SDRAM_BASE ; + gd->bd->bi_dram[0 ].size = gd->ram_size; }Mingkai,
Quoted 4 lines
There is an issue with this function. If you have large memory, you will have more than one bank, won't you?
York
You're right. If memory is larger than 2G, we need more than one bank.
The RDB board have 2G soldered DDR chip, that's the reason why I only put one bank here.
I will submit the patch to add another bank for large memory case.
Thanks,
Mingkai
PATCH v8 13/17 armv8/ls1043ardb: Add nand boot support
In reply to Gong Qianyu---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- Add enable_layerscape_ns_access() in fsl-layerscape/spl.c
V3:
- No change.
V2:
- Removed unecessary NAND_PAGE_SIZE in ls1043a_common.h.
- Fixed "select SUPPORT_SPL" in arch/arm/Kconfig.
- Used CONFIG_FSL_IFC instead of SPL_NAND_SUPPORT for init_early_memctl_regs()
- Replaced ns_access.h with fsl_csu.h
arch/arm/Kconfig | 1 + arch/arm/cpu/armv8/fsl-layerscape/spl.c | 3 ++ board/freescale/ls1043ardb/README | 1 + board/freescale/ls1043ardb/cpld.c | 19 +++++++++ board/freescale/ls1043ardb/cpld.h | 1 + board/freescale/ls1043ardb/ls1043ardb_pbi.cfg | 14 +++++++ board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg | 7 ++++ configs/ls1043ardb_nand_defconfig | 4 ++ include/configs/ls1043a_common.h | 27 +++++++++++++ include/configs/ls1043ardb.h | 46 ++++++++++++++++++++++ 10 files changed, 123 insertions(+)
arch/arm/Kconfig +1 -0
@@ -630,6 +630,7 @@ config TARGET_LS1021ATWR config TARGET_LS1043ARDB bool "Support ls1043ardb" select ARM64 + select SUPPORT_SPL help Support for Freescale LS1043ARDB platform.
arch/arm/cpu/armv8/fsl-layerscape/spl.c +3 -0
@@ -71,6 +71,9 @@ void board_init_f(ulong dummy)/* Clear the BSS */ memset (__bss_start,0 , __bss_end - __bss_start); +#ifdef CONFIG_LAYERSCAPE_NS_ACCESS +enable_layerscape_ns_access (); +#endif board_init_r(NULL, 0); }#endif
board/freescale/ls1043ardb/README +1 -0
@@ -83,3 +83,4 @@ Start Address End Address Description Size Booting Options --------------- a) NOR boot +b) NAND boot
board/freescale/ls1043ardb/cpld.c +19 -0
@@ -45,6 +45,22 @@ void cpld_set_defbank(void)CPLD_WRITE (global_rst,1 ); } +void cpld_set_nand (void ) +{ +u16 reg =CPLD_CFG_RCW_SRC_NAND ; +u8 reg5 = (u8)(reg >>1 ); +u8 reg6 = (u8)(reg &1 ); + +cpld_rev_bit (®5); + +CPLD_WRITE (soft_mux_on,1 ); + +CPLD_WRITE (cfg_rcw_src1, reg5); +CPLD_WRITE (cfg_rcw_src2, reg6); + +CPLD_WRITE (system_rst,1 ); +} +#ifdef DEBUG static void cpld_dump_regs (void ) {
@@ -91,6 +107,8 @@ int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])if (strcmp (argv[1 ],"reset" ) ==0 ) {if (strcmp (argv[2 ],"altbank" ) ==0 )cpld_set_altbank (); +else if (strcmp (argv[2 ],"nand" ) ==0 ) +cpld_set_nand ();else cpld_set_defbank ();#ifdef DEBUG
@@ -109,6 +127,7 @@ U_BOOT_CMD("Reset the board or alternate bank" ,"reset: reset to default bank\n" "cpld reset altbank: reset to alternate bank\n" +"cpld reset nand: reset to boot from NAND flash\n" #ifdef DEBUG"cpld dump - display the CPLD registers\n" #endif
board/freescale/ls1043ardb/cpld.h +1 -0
@@ -40,4 +40,5 @@ void cpld_rev_bit(unsigned char *value);#define CPLD_SW_MUX_BANK_SEL 0x40#define CPLD_BANK_SEL_MASK 0x07#define CPLD_BANK_SEL_ALTBANK 0x04 +#define CPLD_CFG_RCW_SRC_NAND 0x106#endif
board/freescale/ls1043ardb/ls1043ardb_pbi.cfg new file +14 -0
@@ -0,0 +1,14 @@ +#Configure Scratch register +09570600 00000000 +09570604 10000000 +#Alt base register +09570158 00001000 +#Disable CCI barrier tranaction +09570178 0000e010 +09180000 00000008 +#USB PHY frequency sel +09570418 0000009e +0957041c 0000009e +09570420 0000009e +#flush PBI data +096100c0 000fffff
board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg new file +7 -0
@@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# serdes protocol +0810000f 0c000000 00000000 00000000 +14550002 80004012 e0106000 61002000 +00000000 00000000 00000000 00038800 +00000000 00001100 00000096 00000001
configs/ls1043ardb_nand_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,NAND_BOOT,SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043ARDB=y
include/configs/ls1043a_common.h +27 -0
@@ -60,6 +60,33 @@#define CONFIG_BAUDRATE 115200#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } +/* NAND SPL */ +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SPL_PBL_PAD +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" +#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1a000 +#define CONFIG_SPL_STACK 0x1001d000 +#define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_SPL_MALLOC_START 0x80200000 +#define CONFIG_SPL_BSS_START_ADDR 0x80100000 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 +#define CONFIG_SYS_MONITOR_LEN 0xa0000 +#endif +/* IFC */ #define CONFIG_FSL_IFC /*
include/configs/ls1043ardb.h +46 -0
86 lines not on this page · raw message
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 14/17 armv8/ls1043a: Add Fman support
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- Change arch to layerscape.
V3:
- No change.
V2:
- No change.
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 12 +++ arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 6 ++ .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c | 23 ++++ board/freescale/common/fman.c | 6 +- board/freescale/ls1043ardb/Makefile | 1 + board/freescale/ls1043ardb/eth.c | 77 +++++++++++++ board/freescale/ls1043ardb/ls1043ardb.c | 4 + doc/README.fsl-dpaa | 4 +- drivers/net/fm/Makefile | 1 + drivers/net/fm/init.c | 10 +- drivers/net/fm/ls1043.c | 119 +++++++++++++++++++++ include/configs/ls1043a_common.h | 12 +++ include/configs/ls1043ardb.h | 25 +++++ 13 files changed, 295 insertions(+), 5 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +12 -0
@@ -274,6 +274,9 @@ static inline void final_mmu_setup(void)flush_dcache_range (gd->arch.tlb_addr, gd->arch.tlb_addr + gd->arch.tlb_size); +#ifdef CONFIG_SYS_DPAA_FMAN +flush_dcache_all (); +#endif /* point TTBR to the new table */ el =current_el ();
@@ -432,6 +435,9 @@ int print_cpuinfo(void)printf ("\n Bus: %-4s MHz " ,strmhz (buf, sysinfo.freq_systembus));printf ("DDR: %-4s MT/s" ,strmhz (buf, sysinfo.freq_ddrbus)); +#ifdef CONFIG_SYS_DPAA_FMAN +printf (" FMAN: %-4s MHz" ,strmhz (buf, sysinfo.freq_fman[0 ])); +#endif #ifdef CONFIG_FSL_LSCH3 printf (" DP-DDR: %-4s MT/s" ,strmhz (buf, sysinfo.freq_ddrbus2));#endif
@@ -468,6 +474,9 @@ int cpu_eth_init(bd_t *bis)#ifdef CONFIG_FSL_MC_ENET error =fsl_mc_ldpaa_init (bis);#endif +#ifdef CONFIG_FMAN_ENET +fm_standard_init (bis); +#endif return error; }
@@ -484,6 +493,9 @@ int arch_early_init_r(void)#ifdef CONFIG_SYS_HAS_SERDES fsl_serdes_init ();#endif +#ifdef CONFIG_FMAN_ENET +fman_enet_init (); +#endif return 0 ; }
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +6 -0
@@ -18,6 +18,12 @@#include <asm/arch/mp.h> #endif +int fdt_fixup_phy_connection (void *blob,int offset,phy_interface_t phyc) +{ +return fdt_setprop_string (blob, offset,"phy-connection-type" , +phy_string_for_interface (phyc)); +} +#ifdef CONFIG_MP void ft_fixup_cpu (void *blob) {
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c +23 -0
@@ -25,6 +25,9 @@ void get_sys_info(struct sys_info *sys_info)struct fsl_ifc ifc_regs = {(void *)CONFIG_SYS_IFC_ADDR , (void *)NULL };u32 ccr;#endif +#ifdef CONFIG_SYS_DPAA_FMAN +u32 rcw_tmp; +#endif struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_CLK_ADDR );unsigned int cpu;const u8 core_cplx_pll[8 ] = {
@@ -79,6 +82,26 @@ void get_sys_info(struct sys_info *sys_info)#define HWA_CGA_M1_CLK_SEL 0xe0000000#define HWA_CGA_M1_CLK_SHIFT 29 +#ifdef CONFIG_SYS_DPAA_FMAN + rcw_tmp =in_be32 (&gur->rcwsr[7 ]); +switch ((rcw_tmp &HWA_CGA_M1_CLK_SEL ) >>HWA_CGA_M1_CLK_SHIFT ) { +case 2 : + sys_info->freq_fman[0 ] = freq_c_pll[0 ] /2 ; +break ; +case 3 : + sys_info->freq_fman[0 ] = freq_c_pll[0 ] /3 ; +break ; +case 6 : + sys_info->freq_fman[0 ] = freq_c_pll[1 ] /2 ; +break ; +case 7 : + sys_info->freq_fman[0 ] = freq_c_pll[1 ] /3 ; +break ; +default : +printf ("Error: Unknown FMan1 clock select!\n" ); +break ; + } +#endif #define HWA_CGA_M2_CLK_SEL 0x00000007#define HWA_CGA_M2_CLK_SHIFT 0
board/freescale/common/fman.c +5 -1
@@ -1,5 +1,5 @@/* -* Copyright 2011 Freescale Semiconductor, Inc. +* Copyright 2011-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -10,7 +10,11 @@#include <fdt_support.h> #include <fm_eth.h> +#ifdef CONFIG_FSL_LAYERSCAPE +#include <asm/arch/fsl_serdes.h> +#else #include <asm/fsl_serdes.h> +#endif /* * Given the following ...
board/freescale/ls1043ardb/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-y += cpld.o obj-y += ddr.o obj-y += ls1043ardb.o +obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o
board/freescale/ls1043ardb/eth.c new file +77 -0
77 lines not on this page · raw message
board/freescale/ls1043ardb/ls1043ardb.c +4 -0
@@ -13,6 +13,7 @@#include <hwconfig.h> #include <ahci.h> #include <scsi.h> +#include <fm_eth.h> #include <fsl_csu.h> #include <fsl_esdhc.h> #include <fsl_ifc.h>
@@ -108,6 +109,9 @@ int ft_board_setup(void *blob, bd_t *bd) {ft_cpu_setup (blob, bd); +#ifdef CONFIG_SYS_DPAA_FMAN +fdt_fixup_fman_ethernet (blob); +#endif return 0 ; }
doc/README.fsl-dpaa +2 -2
@@ -2,9 +2,9 @@ This file documents Freescale DPAA-specific options. FMan (Frame Manager) - CONFIG_FSL_FM_10GEC_REGULAR_NOTATION - on SoCs earlier(e.g. T4240, T2080), the notation between 10GEC and MAC as below: + on SoCs T4240, T2080, LS1043A, etc, the notation between 10GEC and MAC as below: 10GEC1->MAC9, 10GEC2->MAC10, 10GEC3->MAC1, 10GEC4->MAC2 - on SoCs later(e.g. T1024, etc), the notation between 10GEC and MAC as below: + on SoCs T1024, etc, the notation between 10GEC and MAC as below: 10GEC1->MAC1, 10GEC2->MAC2 so we introduce CONFIG_FSL_FM_10GEC_REGULAR_NOTATION to identify the new SoCs on which 10GEC enumeration is consistent with MAC enumeration.
drivers/net/fm/Makefile +1 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_PPC_T4160) += t4240.o obj-$(CONFIG_PPC_T4080) += t4240.o obj-$(CONFIG_PPC_B4420) += b4860.o obj-$(CONFIG_PPC_B4860) += b4860.o +obj-$(CONFIG_LS1043A) += ls1043.o
drivers/net/fm/init.c +8 -2
@@ -1,13 +1,17 @@/* -* Copyright 2011 Freescale Semiconductor, Inc. +* Copyright 2011-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ #include <errno.h> #include <common.h> #include <asm/io.h> -#include <asm/fsl_serdes.h> #include <fsl_mdio.h> +#ifdef CONFIG_FSL_LAYERSCAPE +#include <asm/arch/fsl_serdes.h> +#else +#include <asm/fsl_serdes.h> +#endif #include "fm.h"
@@ -153,7 +157,9 @@ void fm_disable_port(enum fm_port port)return ; fm_info[i].enabled =0 ; +#ifndef CONFIG_SYS_FMAN_V3 fman_disable_port (port); +#endif }void fm_enable_port (enum fm_port port)
drivers/net/fm/ls1043.c new file +119 -0
119 lines not on this page · raw message
include/configs/ls1043a_common.h +12 -0
@@ -153,6 +153,18 @@#define CONFIG_CMD_ENV #define CONFIG_CMD_PING +/* FMan ucode */ +#define CONFIG_SYS_DPAA_FMAN +#ifdef CONFIG_SYS_DPAA_FMAN +#define CONFIG_SYS_FM_MURAM_SIZE 0x60000 + +#define CONFIG_SYS_QE_FMAN_FW_IN_NOR +/* FMan fireware Pre-load address */ +#define CONFIG_SYS_FMAN_FW_ADDR 0x60300000 +#define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000 +#define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH) +#endif +/* Miscellaneous configurable options */ #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000)#define CONFIG_ARCH_EARLY_INIT_R
include/configs/ls1043ardb.h +25 -0
@@ -234,4 +234,29 @@#define CONFIG_ENV_SIZE 0x20000#endif +/* FMan */ +#ifdef CONFIG_SYS_DPAA_FMAN +#define CONFIG_FMAN_ENET +#define CONFIG_CMD_MII +#define CONFIG_PHYLIB +#define CONFIG_PHYLIB_10G +#define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */ + +#define CONFIG_PHY_VITESSE +#define CONFIG_PHY_REALTEK +#define CONFIG_PHY_AQUANTIA + +#define RGMII_PHY1_ADDR 0x1 +#define RGMII_PHY2_ADDR 0x2 + +#define QSGMII_PORT1_PHY_ADDR 0x4 +#define QSGMII_PORT2_PHY_ADDR 0x5 +#define QSGMII_PORT3_PHY_ADDR 0x6 +#define QSGMII_PORT4_PHY_ADDR 0x7 + +#define FM1_10GEC1_PHY_ADDR 0x1 + +#define CONFIG_ETHPRIME "FM1 at DTSEC3" +#endif +#endif /* __LS1043ARDB_H__ */
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 15/17 armv8/ls1043ardb: esdhc: Add esdhc support for ls1043ardb
In reply to Gong QianyuFrom: Yangbo Lu <[email protected]>
This patch adds esdhc support for ls1043ardb.
---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- Use CONFIG_FSL_ESDHC to enable get_sdhc_freq().
- Merge lsch2 and lsch3 into layerscape.
V3:
- No change.
V2:
- No change.
.../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c | 22 +++++++++++++++++++++- board/freescale/ls1043ardb/ls1043ardb.c | 1 + drivers/mmc/fsl_esdhc.c | 12 ++++++------ include/configs/ls1043a_common.h | 11 +++++++++++ include/fsl_esdhc.h | 2 +- 5 files changed, 40 insertions(+), 8 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c +21 -1
@@ -25,7 +25,7 @@ void get_sys_info(struct sys_info *sys_info)struct fsl_ifc ifc_regs = {(void *)CONFIG_SYS_IFC_ADDR , (void *)NULL };u32 ccr;#endif -#ifdef CONFIG_SYS_DPAA_FMAN +#if defined(CONFIG_FSL_ESDHC ) || defined(CONFIG_SYS_DPAA_FMAN )u32 rcw_tmp;#endif struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_CLK_ADDR );
@@ -105,6 +105,11 @@ void get_sys_info(struct sys_info *sys_info)#define HWA_CGA_M2_CLK_SEL 0x00000007#define HWA_CGA_M2_CLK_SHIFT 0 +#ifdef CONFIG_FSL_ESDHC + rcw_tmp =in_be32 (&gur->rcwsr[15 ]); + rcw_tmp = (rcw_tmp &HWA_CGA_M2_CLK_SEL ) >>HWA_CGA_M2_CLK_SHIFT ; + sys_info->freq_sdhc = freq_c_pll[1 ] / rcw_tmp; +#endif #if defined(CONFIG_FSL_IFC ) ccr =ifc_in32 (&ifc_regs.gregs->ifc_ccr);
@@ -123,6 +128,10 @@ int get_clocks(void) gd->bus_clk = sys_info.freq_systembus; gd->mem_clk = sys_info.freq_ddrbus; +#ifdef CONFIG_FSL_ESDHC + gd->arch.sdhc_clk = sys_info.freq_sdhc; +#endif +if (gd->cpu_clk !=0 )return 0 ;else
@@ -139,6 +148,13 @@ ulong get_ddr_freq(ulong dummy)return gd->mem_clk; } +#ifdef CONFIG_FSL_ESDHC +int get_sdhc_freq (ulong dummy) +{ +return gd->arch.sdhc_clk; +} +#endif +int get_serial_clock (void ) {return gd->bus_clk;
@@ -149,6 +165,10 @@ unsigned int mxc_get_clock(enum mxc_clock clk)switch (clk) {case MXC_I2C_CLK :return get_bus_freq (0 ); +#if defined(CONFIG_FSL_ESDHC ) +case MXC_ESDHC_CLK : +return get_sdhc_freq (0 ); +#endif case MXC_DSPI_CLK :return get_bus_freq (0 );case MXC_UART_CLK :
board/freescale/ls1043ardb/ls1043ardb.c +1 -0
@@ -12,6 +12,7 @@#include <asm/arch/soc.h> #include <hwconfig.h> #include <ahci.h> +#include <mmc.h> #include <scsi.h> #include <fm_eth.h> #include <fsl_csu.h>
drivers/mmc/fsl_esdhc.c +6 -6
@@ -106,7 +106,7 @@ static uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data) xfertyp |=XFERTYP_RSPTYP_48 ;#if defined(CONFIG_MX53 ) || defined(CONFIG_PPC_T4240 ) || \ - defined(CONFIG_LS102XA ) || defined(CONFIG_LS2085A ) + defined(CONFIG_LS102XA ) || defined(CONFIG_FSL_LAYERSCAPE )if (cmd->cmdidx ==MMC_CMD_STOP_TRANSMISSION ) xfertyp |=XFERTYP_CMDTYP_ABORT ;#endif
@@ -184,7 +184,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)int timeout;struct fsl_esdhc_cfg *cfg = mmc->priv;struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base; -#ifdef CONFIG_LS2085A +#ifdef CONFIG_FSL_LAYERSCAPE dma_addr_t addr;#endif uint wml_value;
@@ -197,7 +197,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#ifdef CONFIG_LS2085A +#ifdef CONFIG_FSL_LAYERSCAPE addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );
@@ -223,7 +223,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#ifdef CONFIG_LS2085A +#ifdef CONFIG_FSL_LAYERSCAPE addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );
@@ -277,7 +277,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)static void check_and_invalidate_dcache_range (struct mmc_cmd *cmd,struct mmc_data *data) { -#ifdef CONFIG_LS2085A +#ifdef CONFIG_FSL_LAYERSCAPE unsigned start =0 ;#else unsigned start = (unsigned )data->dest ;
@@ -285,7 +285,7 @@ static void check_and_invalidate_dcache_rangeunsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize);unsigned end = start+size ; -#ifdef CONFIG_LS2085A +#ifdef CONFIG_FSL_LAYERSCAPE dma_addr_t addr; addr =virt_to_phys ((void *)(data->dest));
include/configs/ls1043a_common.h +11 -0
@@ -153,6 +153,17 @@#define CONFIG_CMD_ENV #define CONFIG_CMD_PING +/* MMC */ +#define CONFIG_MMC +#ifdef CONFIG_MMC +#define CONFIG_CMD_MMC +#define CONFIG_CMD_FAT +#define CONFIG_FSL_ESDHC +#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 +#define CONFIG_GENERIC_MMC +#define CONFIG_DOS_PARTITION +#endif +/* FMan ucode */ #define CONFIG_SYS_DPAA_FMAN #ifdef CONFIG_SYS_DPAA_FMAN
include/fsl_esdhc.h +1 -1
@@ -166,7 +166,7 @@#define ESDHC_VENDORSPEC_VSELECT 0x00000002/* Use 1.8V */ struct fsl_esdhc_cfg { -#ifdef CONFIG_LS2085A +#ifdef CONFIG_FSL_LAYERSCAPE u64 esdhc_base;#else u32 esdhc_base;
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 16/17 armv8/ls1043ardb: Add sd boot support
In reply to Gong Qianyu---
V8:
- No changes.
V7:
- No change.
V6:
- No change.
V5:
- No change.
V4:
- No change.
V3:
- Squash the add cpld command patch to it.
V2:
- No change.
board/freescale/ls1043ardb/README | 1 + board/freescale/ls1043ardb/cpld.c | 18 ++++++++++++++ board/freescale/ls1043ardb/cpld.h | 1 + board/freescale/ls1043ardb/ls1043ardb.c | 6 +++++ board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg | 7 ++++++ configs/ls1043ardb_sdcard_defconfig | 4 ++++ include/configs/ls1043a_common.h | 30 ++++++++++++++++++++++++ include/configs/ls1043ardb.h | 11 ++++++++- 8 files changed, 77 insertions(+), 1 deletion(-)
board/freescale/ls1043ardb/README +1 -0
@@ -84,3 +84,4 @@ Booting Options --------------- a) NOR boot b) NAND boot +c) SD boot
board/freescale/ls1043ardb/cpld.c +18 -0
@@ -61,6 +61,21 @@ void cpld_set_nand(void)CPLD_WRITE (system_rst,1 ); } +void cpld_set_sd (void ) +{ +u16 reg =CPLD_CFG_RCW_SRC_SD ; +u8 reg5 = (u8)(reg >>1 ); +u8 reg6 = (u8)(reg &1 ); + +cpld_rev_bit (®5); + +CPLD_WRITE (soft_mux_on,1 ); + +CPLD_WRITE (cfg_rcw_src1, reg5); +CPLD_WRITE (cfg_rcw_src2, reg6); + +CPLD_WRITE (system_rst,1 ); +}#ifdef DEBUG static void cpld_dump_regs (void ) {
@@ -109,6 +124,8 @@ int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])cpld_set_altbank (); else if (strcmp(argv[2], "nand") == 0) cpld_set_nand(); + else if (strcmp(argv[2], "sd") == 0) + cpld_set_sd(); elsecpld_set_defbank ();#ifdef DEBUG
@@ -128,6 +145,7 @@ U_BOOT_CMD("reset: reset to default bank\n" "cpld reset altbank: reset to alternate bank\n" "cpld reset nand: reset to boot from NAND flash\n" +"cpld reset sd: reset to boot from SD card\n" #ifdef DEBUG"cpld dump - display the CPLD registers\n" #endif
board/freescale/ls1043ardb/cpld.h +1 -0
@@ -41,4 +41,5 @@ void cpld_rev_bit(unsigned char *value);#define CPLD_BANK_SEL_MASK 0x07#define CPLD_BANK_SEL_ALTBANK 0x04#define CPLD_CFG_RCW_SRC_NAND 0x106 +#define CPLD_CFG_RCW_SRC_SD 0x040#endif
board/freescale/ls1043ardb/ls1043ardb.c +6 -0
@@ -25,12 +25,17 @@ DECLARE_GLOBAL_DATA_PTR;int checkboard (void ) {static const char *freq[3 ] = {"100.00MHZ" ,"156.25MHZ" }; +#ifndef CONFIG_SD_BOOT u8 cfg_rcw_src1, cfg_rcw_src2;u32 cfg_rcw_src; +#endif u32 sd1refclk_sel;printf ("Board: LS1043ARDB, boot from " ); +#ifdef CONFIG_SD_BOOT +puts ("SD\n" ); +#else cfg_rcw_src1 =CPLD_READ (cfg_rcw_src1); cfg_rcw_src2 =CPLD_READ (cfg_rcw_src2);cpld_rev_bit (&cfg_rcw_src1);
@@ -43,6 +48,7 @@ int checkboard(void)puts ("NAND\n" ); else printf("Invalid setting of SW4\n"); +#endif printf ("CPLD: V%x.%x\nPCBA: V%x.0\n" ,CPLD_READ (cpld_ver),CPLD_READ (cpld_ver_sub),CPLD_READ (pcba_ver));
board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg new file +7 -0
@@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +0810000f 0c000000 00000000 00000000 +14550002 80004012 60040000 61002000 +00000000 00000000 00000000 00038800 +00000000 00001100 00000096 00000001
configs/ls1043ardb_sdcard_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT,SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043ARDB=y
include/configs/ls1043a_common.h +30 -0
@@ -60,6 +60,36 @@#define CONFIG_BAUDRATE 115200#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } +/* SD boot SPL */ +#ifdef CONFIG_SD_BOOT +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" +#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_MMC_SUPPORT +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0xf0 +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x500 + +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1d000 +#define CONFIG_SPL_STACK 0x1001e000 +#define CONFIG_SPL_PAD_TO 0x1d000 + +#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_TEXT_BASE + \ + CONFIG_SYS_MONITOR_LEN) +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 +#define CONFIG_SPL_BSS_START_ADDR 0x80100000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 +#define CONFIG_SYS_MONITOR_LEN 0xa0000 +#endif +/* NAND SPL */ #ifdef CONFIG_NAND_BOOT #define CONFIG_SPL_PBL_PAD
include/configs/ls1043ardb.h +10 -1
@@ -12,7 +12,7 @@#define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#if defined(CONFIG_NAND_BOOT ) +#if defined(CONFIG_NAND_BOOT ) || defined(CONFIG_SD_BOOT )#define CONFIG_SYS_TEXT_BASE 0x82000000#else #define CONFIG_SYS_TEXT_BASE 0x60100000
@@ -45,6 +45,10 @@#define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg#endif +#ifdef CONFIG_SD_BOOT +#define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg +#endif +/* * NOR Flash Definitions */
@@ -227,6 +231,11 @@#define CONFIG_ENV_IS_IN_NAND #define CONFIG_ENV_SIZE 0x2000#define CONFIG_ENV_OFFSET (10 * CONFIG_SYS_NAND_BLOCK_SIZE) +#elif defined(CONFIG_SD_BOOT ) +#define CONFIG_ENV_OFFSET (1024 * 1024) +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE 0x2000#else #define CONFIG_ENV_IS_IN_FLASH #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x200000)
Signature · 1 line
2.1.0.27.g96db324
PATCH v8 17/17 armv8/ls1043a: Enable secondary cores
In reply to Gong QianyuFrom: Hou Zhiqiang <[email protected]>
After the secondary cores enter U-Boot, use CONFIG_ARMV8_MULTIENTRY to make secondary cores excute in spin loop.
---
V8:
- No changes.
V7:
- No change.
V6:
- New patch.
arch/arm/Kconfig | 1 + arch/arm/cpu/armv8/fsl-layerscape/mp.c | 14 ++++++++++++++ include/configs/ls1043a_common.h | 3 +++ 3 files changed, 18 insertions(+)
arch/arm/Kconfig +1 -0
@@ -630,6 +630,7 @@ config TARGET_LS1021ATWR config TARGET_LS1043ARDB bool "Support ls1043ardb" select ARM64 + select ARMV8_MULTIENTRY select SUPPORT_SPL help Support for Freescale LS1043ARDB platform.
arch/arm/cpu/armv8/fsl-layerscape/mp.c +14 -0
@@ -25,7 +25,11 @@ phys_addr_t determine_mp_bootpg(void)int fsl_layerscape_wake_seconday_cores (void ) {struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR ); +#ifdef CONFIG_FSL_LSCH3 struct ccsr_reset __iomem *rst = (void *)(CONFIG_SYS_FSL_RST_ADDR ); +#elif defined(CONFIG_FSL_LSCH2 ) +struct ccsr_scfg __iomem *scfg = (void *)(CONFIG_SYS_FSL_SCFG_ADDR ); +#endif u32 cores, cpu_up_mask =1 ;int i, timeout =10 ;u64 *table =get_spin_tbl_addr ();
@@ -48,13 +52,23 @@ int fsl_layerscape_wake_seconday_cores(void)printf ("Waking secondary cores to start from %lx\n" , gd->relocaddr); +#ifdef CONFIG_FSL_LSCH3 gur_out32 (&gur->bootlocptrh, (u32)(gd->relocaddr >>32 ));gur_out32 (&gur->bootlocptrl, (u32 )gd->relocaddr);gur_out32 (&gur->scratchrw[6 ],1 ); asmvolatile ("dsb st" : : :"memory" ); rst->brrl = cores; asmvolatile ("dsb st" : : :"memory" ); +#elif defined(CONFIG_FSL_LSCH2 ) +scfg_out32 (&scfg->scratchrw[0 ], (u32)(gd->relocaddr >>32 )); +scfg_out32 (&scfg->scratchrw[1 ], (u32 )gd->relocaddr); + asmvolatile ("dsb st" : : :"memory" ); +gur_out32 (&gur->brrl, cores); + asmvolatile ("dsb st" : : :"memory" ); +/* Bootup online cores */ +scfg_out32 (&scfg->corebcr, cores); +#endif /* This is needed as a precautionary measure. * If some code before this has accidentally released the secondary * cores then the pre-bootloader code will trap them in a "wfe" unless
include/configs/ls1043a_common.h +3 -0
@@ -11,6 +11,7 @@#define CONFIG_FSL_LAYERSCAPE #define CONFIG_FSL_LSCH2 #define CONFIG_LS1043A +#define CONFIG_MP #define CONFIG_SYS_FSL_CLK #define CONFIG_GICV2
@@ -44,6 +45,8 @@#define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE +#define CPU_RELEASE_ADDR secondary_boot_func +/* Generic Timer Definitions */ #define COUNTER_FREQUENCY 25000000/* 25MHz */
Signature · 1 line
2.1.0.27.g96db324
v8 cover add LS1043A platform support
In reply to Gong QianyuQuoted 16 lines · Gong Qianyu
Hi all,
Here are the changes for V8 patchset. Please help to review them.
- Update the patch based on the latest U-Boot code.
- Remove "net/fm/eth: Usemb()to be compatible for both ARM"[Patch V8 01/17]
common/board_f.c: change the macro name and remove [Patch V8 02/17] armv7/ls1021a: movens_accessto common file [Patch V8 03/17] net/fm: Fix the endian issue to support both [Patch V8 04/17] net/fm: Add support for 64-bit platforms [Patch V8 05/17] net/fm: Make the return value logic consistent with [Patch V8 06/17] net: fm: bug fix whenCONFIG_PHYLIBnot defined [Patch V8 07/17] net: Move some header files toinclude/[Patch V8 08/17] net/fm: Add QSGMII PCS init
[Patch V8 09/17] net/fm: fix MDIO controller base on FMAN2
Quoted 9 lines
[Patch V8 10/17] armv8/fsl_lsch3: Change arch to fsl-layerscape [Patch V8 11/17] armv8/fsl_lsch2: Add
fsl_lsch2SoC [Patch V8 12/17] armv8/ls1043ardb: Add LS1043ARDB board support [Patch V8 13/17] armv8/ls1043ardb: Add nand boot support [Patch V8 14/17] armv8/ls1043a: Add Fman support [Patch V8 15/17] armv8/ls1043ardb: esdhc: Add esdhc support for [Patch V8 16/17] armv8/ls1043ardb: Add sd boot support [Patch V8 17/17] armv8/ls1043a: Enable secondary cores
Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.
York