add LS1043AQDS support
Subsystems (2)
v2 cover add LS1043AQDS support
Hi all,
Here are the changes for V2 patchset. Please help to review them.
- Fix pcie compile errors for LS1021A.
- Add LS1043ARDB and LS1043AQDS dtb support in U-Boot.
[Patch V2 1/4] pci/layerscape: add support for LS1043A PCIe LUT [Patch V2 2/4] armv8/ls1043ardb: dts: add dtb support [Patch V2 3/4] armv8/ls1043aqds: add LS1043AQDS board support [Patch V2 4/4] armv8/ls1043aqds: dts: add dtb support
Thanks,
Qianyu
PATCH v2 1/4 pci/layerscape: add support for LS1043A PCIe LUT register access
From: Mingkai Hu <[email protected]>
The endian and base address of PEX LUT register region is different between Chassis 2 and Chassis 3, so move the base address definition to chassis specific header file and add pex_lut_* functions to access LUT register.
---
V2:
- Fix compile errors for ls1021a.
arch/arm/include/asm/arch-fsl-layerscape/config.h | 2 ++ arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h | 4 ++++ arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h | 4 ++++ arch/arm/include/asm/arch-fsl-layerscape/soc.h | 8 ++++++++ drivers/pci/pcie_layerscape.c | 14 +++++++------- 5 files changed, 25 insertions(+), 7 deletions(-)
arch/arm/include/asm/arch-fsl-layerscape/config.h +2 -0
@@ -44,6 +44,7 @@#define CONFIG_SYS_FSL_CCSR_SCFG_LE #define CONFIG_SYS_FSL_ESDHC_LE #define CONFIG_SYS_FSL_IFC_LE +#define CONFIG_SYS_FSL_PEX_LUT_LE #define CONFIG_SYS_MEMAC_LITTLE_ENDIAN
@@ -113,6 +114,7 @@#define CONFIG_SYS_FSL_WDOG_BE #define CONFIG_SYS_FSL_DSPI_BE #define CONFIG_SYS_FSL_QSPI_BE +#define CONFIG_SYS_FSL_PEX_LUT_BE #define QE_MURAM_SIZE 0x6000UL#define MAX_QE_RISC 1
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +4 -0
@@ -60,6 +60,10 @@#define CONFIG_SYS_PCIE1_PHYS_ADDR 0x4000000000ULL#define CONFIG_SYS_PCIE2_PHYS_ADDR 0x4800000000ULL#define CONFIG_SYS_PCIE3_PHYS_ADDR 0x5000000000ULL +/* LUT registers */ +#define PCIE_LUT_BASE 0x10000 +#define PCIE_LUT_LCTRL0 0x7F8 +#define PCIE_LUT_DBG 0x7FC/* TZ Address Space Controller Definitions */ #define TZASC1_BASE 0x01100000/* as per CCSR map. */
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h +4 -0
@@ -78,6 +78,10 @@#define CONFIG_SYS_PCIE2_PHYS_ADDR 0x1200000000ULL#define CONFIG_SYS_PCIE3_PHYS_ADDR 0x1400000000ULL#define CONFIG_SYS_PCIE4_PHYS_ADDR 0x1600000000ULL +/* LUT registers */ +#define PCIE_LUT_BASE 0x80000 +#define PCIE_LUT_LCTRL0 0x7F8 +#define PCIE_LUT_DBG 0x7FC/* Device Configuration */ #define DCFG_BASE 0x01e00000
arch/arm/include/asm/arch-fsl-layerscape/soc.h +8 -0
@@ -23,6 +23,14 @@#define scfg_out32 (a, v) out_be32(a, v)#endif +#ifdef CONFIG_SYS_FSL_PEX_LUT_LE +#define pex_lut_in32 (a) in_le32(a) +#define pex_lut_out32 (a, v) out_le32(a, v) +#elif defined(CONFIG_SYS_FSL_PEX_LUT_BE ) +#define pex_lut_in32 (a) in_be32(a) +#define pex_lut_out32 (a, v) out_be32(a, v) +#endif +struct cpu_type {char name[15 ];u32 soc_ver;
drivers/pci/pcie_layerscape.c +7 -7
@@ -13,6 +13,7 @@#include <malloc.h> #ifdef CONFIG_FSL_LAYERSCAPE #include <asm/arch/fdt.h> +#include <asm/arch/soc.h> #endif #ifndef CONFIG_SYS_PCI_MEMORY_BUS
@@ -57,11 +58,6 @@#define PCIE_ATU_FUNC (x) (((x) & 0x7) << 16)#define PCIE_ATU_UPPER_TARGET 0x91C -/* LUT registers */ -#define PCIE_LUT_BASE 0x80000 -#define PCIE_LUT_LCTRL0 0x7F8 -#define PCIE_LUT_DBG 0x7FC -#define PCIE_DBI_RO_WR_EN 0x8bc#define PCIE_LINK_CAP 0x7c
@@ -157,12 +153,12 @@ static int ls_pcie_link_state(struct ls_pcie *pcie) return 1; } -#else +#elif defined(CONFIG_FSL_LAYERSCAPE)static int ls_pcie_link_state (struct ls_pcie *pcie) {u32 state; - state =readl (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) & + state =pex_lut_in32 (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) <SSM_STATE_MASK ;if (state <LTSSM_PCIE_L0 ) {debug ("....PCIe link error. LTSSM=0x%02x.\n" , state);
@@ -466,16 +462,20 @@ static void ls_pcie_setup_ep(struct ls_pcie *pcie, struct ls_pcie_info *info)for (pf =0 ; pf <PCIE_PF_NUM ; pf++) {for (vf =0 ; vf <=PCIE_VF_NUM ; vf++) { +#ifdef CONFIG_FSL_LAYERSCAPE writel (PCIE_LCTRL0_VAL (pf, vf), pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_LCTRL0 ); +#endif ls_pcie_ep_setup_bars (pcie->dbi);ls_pcie_ep_setup_atu (pcie, info); } }/* Disable CFG2 */ +#ifdef CONFIG_FSL_LAYERSCAPE writel (0 , pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_LCTRL0 ); +#endif }else {ls_pcie_ep_setup_bars (pcie->dbi +PCIE_NO_SRIOV_BAR_BASE );ls_pcie_ep_setup_atu (pcie, info);
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 1/4 pci/layerscape: add support for LS1043A PCIe LUT register access
Quoted 40 lines · Gong Qianyu
drivers/pci/pcie_layerscape.c +3
-7@@ -13,6 +13,7 @@#include <malloc.h> #ifdef CONFIG_FSL_LAYERSCAPE #include <asm/arch/fdt.h> +#include <asm/arch/soc.h> #endif #ifndef CONFIG_SYS_PCI_MEMORY_BUS @@ -57,11 +58,6 @@#define PCIE_ATU_FUNC (x) (((x) & 0x7) << 16)#define PCIE_ATU_UPPER_TARGET 0x91C -/* LUT registers */ -#define PCIE_LUT_BASE 0x80000 -#define PCIE_LUT_LCTRL0 0x7F8 -#define PCIE_LUT_DBG 0x7FC -#define PCIE_DBI_RO_WR_EN 0x8bc#define PCIE_LINK_CAP 0x7c@@ -157,12 +153,12 @@ static int ls_pcie_link_state(struct ls_pcie *pcie) return 1; } -#else +#elif defined(CONFIG_FSL_LAYERSCAPE)static int ls_pcie_link_state (struct ls_pcie *pcie) {u32 state; - state =readl (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) & + state =pex_lut_in32 (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) <SSM_STATE_MASK ;if (state <LTSSM_PCIE_L0 ) {debug ("....PCIe link error. LTSSM=0x%02x.\n" , state);
drivers/pci/pcie_layerscape.c static void ls_pcie_setup_ep(struct ls_pcie *pcie, · line 470
Quoted 9 lines
drivers/pci/pcie_layerscape.c +2
-0@@ -466,16 +462,20 @@ static void ls_pcie_setup_ep(struct ls_pcie *pcie, struct ls_pcie_info *info)for (pf =0 ; pf <PCIE_PF_NUM ; pf++) {for (vf =0 ; vf <=PCIE_VF_NUM ; vf++) { +#ifdef CONFIG_FSL_LAYERSCAPE writel (PCIE_LCTRL0_VAL (pf, vf), pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_LCTRL0 ); +#endif
It looks really weird to have "#ifdef CONFIG_FSL_LAYERSCAPE" inside a file whose name suggests is layerscape-specific. What chips use this file that are not CONFIG_FSL_LAYERSCAPE?
-Scott
PATCH v2 1/4 pci/layerscape: add support for LS1043A PCIe LUT register access
+Simon,
Hi,
Quoted 55 lines · Scott Wood
Quoted 40 lines · Gong Qianyu
drivers/pci/pcie_layerscape.c +3
-7@@ -13,6 +13,7 @@#include <malloc.h> #ifdef CONFIG_FSL_LAYERSCAPE #include <asm/arch/fdt.h> +#include <asm/arch/soc.h> #endif #ifndef CONFIG_SYS_PCI_MEMORY_BUS @@ -57,11 +58,6 @@#define PCIE_ATU_FUNC (x) (((x) & 0x7) << 16)#define PCIE_ATU_UPPER_TARGET 0x91C -/* LUT registers */ -#define PCIE_LUT_BASE 0x80000 -#define PCIE_LUT_LCTRL0 0x7F8 -#define PCIE_LUT_DBG 0x7FC -#define PCIE_DBI_RO_WR_EN 0x8bc#define PCIE_LINK_CAP 0x7c@@ -157,12 +153,12 @@ static int ls_pcie_link_state(struct ls_pcie *pcie) return 1; } -#else +#elif defined(CONFIG_FSL_LAYERSCAPE)static int ls_pcie_link_state (struct ls_pcie *pcie) {u32 state; - state =readl (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) & + state =pex_lut_in32 (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) <SSM_STATE_MASK ;if (state <LTSSM_PCIE_L0 ) {debug ("....PCIe link error. LTSSM=0x%02x.\n" , state);drivers/pci/pcie_layerscape.c static void ls_pcie_setup_ep(struct ls_pcie *pcie, · line 470
Quoted 9 lines
drivers/pci/pcie_layerscape.c +2
-0@@ -466,16 +462,20 @@ static void ls_pcie_setup_ep(struct ls_pcie *pcie, struct ls_pcie_info *info)for (pf =0 ; pf <PCIE_PF_NUM ; pf++) {for (vf =0 ; vf <=PCIE_VF_NUM ; vf++) { +#ifdef CONFIG_FSL_LAYERSCAPE writel (PCIE_LCTRL0_VAL (pf, vf), pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_LCTRL0 ); +#endif It looks really weird to have "#ifdef
CONFIG_FSL_LAYERSCAPE" inside a file whose name suggests is layerscape-specific. What chips use this file that are notCONFIG_FSL_LAYERSCAPE?
Quoted 1 line
-Scott
Can we start converting the driver to use DM PCI? We should not continue using legacy PCI codes since right now DM PCI is in a good shape. These #ifdef in the driver should really go into device tree as needed.
Regards,
Bin
PATCH v2 1/4 pci/layerscape: add support for LS1043A PCIe LUT register access
Hi,
Quoted 60 lines · Bin Meng
+Simon,
Hi,
Quoted 55 lines · Scott Wood
Quoted 40 lines · Gong Qianyu
drivers/pci/pcie_layerscape.c +3
-7@@ -13,6 +13,7 @@#include <malloc.h> #ifdef CONFIG_FSL_LAYERSCAPE #include <asm/arch/fdt.h> +#include <asm/arch/soc.h> #endif #ifndef CONFIG_SYS_PCI_MEMORY_BUS @@ -57,11 +58,6 @@#define PCIE_ATU_FUNC (x) (((x) & 0x7) << 16)#define PCIE_ATU_UPPER_TARGET 0x91C -/* LUT registers */ -#define PCIE_LUT_BASE 0x80000 -#define PCIE_LUT_LCTRL0 0x7F8 -#define PCIE_LUT_DBG 0x7FC -#define PCIE_DBI_RO_WR_EN 0x8bc#define PCIE_LINK_CAP 0x7c@@ -157,12 +153,12 @@ static int ls_pcie_link_state(struct ls_pcie *pcie) return 1; } -#else +#elif defined(CONFIG_FSL_LAYERSCAPE)static int ls_pcie_link_state (struct ls_pcie *pcie) {u32 state; - state =readl (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) & + state =pex_lut_in32 (pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_DBG ) <SSM_STATE_MASK ;if (state <LTSSM_PCIE_L0 ) {debug ("....PCIe link error. LTSSM=0x%02x.\n" , state);drivers/pci/pcie_layerscape.c static void ls_pcie_setup_ep(struct ls_pcie *pcie, · line 470
Quoted 9 lines
drivers/pci/pcie_layerscape.c +2
-0@@ -466,16 +462,20 @@ static void ls_pcie_setup_ep(struct ls_pcie *pcie, struct ls_pcie_info *info)for (pf =0 ; pf <PCIE_PF_NUM ; pf++) {for (vf =0 ; vf <=PCIE_VF_NUM ; vf++) { +#ifdef CONFIG_FSL_LAYERSCAPE writel (PCIE_LCTRL0_VAL (pf, vf), pcie->dbi +PCIE_LUT_BASE +PCIE_LUT_LCTRL0 ); +#endif It looks really weird to have "#ifdef
CONFIG_FSL_LAYERSCAPE" inside a file whose name suggests is layerscape-specific. What chips use this file that are notCONFIG_FSL_LAYERSCAPE?
Quoted 6 lines
Quoted 1 line
-Scott
Can we start converting the driver to use DM PCI? We should not continue using legacy PCI codes since right now DM PCI is in a good shape. These #ifdef in the driver should really go into device tree as needed.
Agreed. In fact I have a series to add a few improvements, will try to get that out in the next week.
Regards,
Simon
PATCH v2 2/4 armv8/ls1043ardb: dts: add dtb support
In reply to Gong QianyuReuse dts files from ls1043a linux kernel. Some parts in dts files may not be needed by U-Boot.
---
V2:
- New Patch.
arch/arm/dts/Makefile | 1 + arch/arm/dts/fsl-ls1043a-rdb.dts | 169 +++++++++++++++++++ arch/arm/dts/fsl-ls1043a.dtsi | 346 +++++++++++++++++++++++++++++++++++++++ configs/ls1043ardb_defconfig | 2 + 4 files changed, 518 insertions(+)
arch/arm/dts/Makefile +1 -0
@@ -83,6 +83,7 @@ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \ ls1021a-twr.dtb dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2085a-qds.dtb \ fsl-ls2085a-rdb.dtb +dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-rdb.dtb dtb-$(CONFIG_MACH_SUN4I) += \ sun4i-a10-a1000.dtb \
arch/arm/dts/fsl-ls1043a-rdb.dts new file +169 -0
169 lines not on this page · raw message
arch/arm/dts/fsl-ls1043a.dtsi new file +346 -0
346 lines not on this page · raw message
configs/ls1043ardb_defconfig +2 -0
@@ -2,3 +2,5 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4" CONFIG_ARM=y CONFIG_TARGET_LS1043ARDB=y CONFIG_FSL_LAYERSCAPE=y +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-rdb" +CONFIG_OF_CONTROL=y
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 2/4 armv8/ls1043ardb: dts: add dtb support
Quoted 174 lines · Gong Qianyu
Reuse dts files from ls1043a linux kernel. Some parts in dts files may not be needed by U-Boot.
Signed-off-by Gong Qianyu <[email protected]>---
V2:
- New Patch.arch/arm/dts/Makefile | 1 + arch/arm/dts/fsl-ls1043a-rdb.dts | 169 +++++++++++++++++++ arch/arm/dts/fsl-ls1043a.dtsi | 346 +++++++++++++++++++++++++++++++++++++++ configs/ls1043ardb_defconfig | 2 + 4 files changed, 518 insertions(+)arch/arm/dts/Makefile +1
-0@@ -83,6 +83,7 @@ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \ ls1021a-twr.dtb dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2085a-qds.dtb \ fsl-ls2085a-rdb.dtb +dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-rdb.dtb dtb-$(CONFIG_MACH_SUN4I) += \ sun4i-a10-a1000.dtb \arch/arm/dts/fsl-ls1043a- renamed from arch/arm/dts/fsl-ls1043a-rdb.dts +0
-0
rdb.dts
new file mode 100644
index 0000000..51b5e9farch/arm/dts/fsl-ls1043a-rdb.dts new file +140
-0@@ -0,0 +1,169 @@ +/* + * Device Tree Include file for Freescale Layerscape-1043A family SoC. + * + * Copyright (C) 2015, Freescale Semiconductor + * + * Mingkai Hu <[email protected]> + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +/dts-v1/; +/include/ "fsl-ls1043a.dtsi" + +/ { + model = "LS1043A RDB Board"; +}; + +&i2c0 { + status = "okay"; + ina220 at 40{ + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + adt7461a at 4c{ + compatible = "adt7461a"; + reg = <0x4c>; + }; + eeprom at 56{ + compatible = "at24,24c512"; + reg = <0x52>; + }; + + eeprom at 57{ + compatible = "at24,24c512"; + reg = <0x53>; + }; + + rtc at 68{ + compatible = "pericom,pt7c4338"; + reg = <0x68>; + }; +}; + +&ifc { + status = "okay"; + #address-cells = <2>; + #size-cells = <1>; + /* NOR, NAND Flashes and FPGA on board */ + ranges = <0x0 0x0 0x0 0x60000000 0x08000000 + 0x2 0x0 0x0 0x7e800000 0x00010000 + 0x3 0x0 0x0 0x7fb00000 0x00000100>; + + nor at 0,0 { + compatible = "cfi-flash"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x0 0x0 0x8000000>; + bank-width = <2>; + device-width = <1>; + + partition at 0{ + /* 1MB for RCW and PBI Image */ + reg = <0x00000000 0x00100000>; + label = "NOR bank0 RCW Image"; + }; + + partition at 100000{ + /* 1MB for bank0 u-boot Image */ + reg = <0x00100000 0x00100000>; + label = "NOR bank0 U-Boot Image"; + }; + + partition at 200000{ + /* 1 MB for bank0 u-boot Env */ + reg = <0x00200000 0x00100000>; + label = "NOR bank0 U-Boot Env"; + }; + + partition at 300000{ + /* 1MB for FMan ucode */ + reg = <0x00300000 0x00100000>; + label = "NOR bank0 FMan ucode"; + }; + + partition at 1100000{ + /* 40MB for bank0 FIT Image */ + reg = <0x01100000 0x2800000>; + label = "NOR bank0 FIT Image"; + }; + + partition at 4000000{ + /* 1MB for bank4 RCW and PBI Image */ + reg = <0x04000000 0x100000>; + label = "NOR bank4 RCW Image"; + }; + + partition at 4100000{ + /* 1MB for bank4 u-boot Image */ + reg = <0x04100000 0x100000>; + label = "NOR bank4 U-Boot Image"; + }; + + partition at 4200000{ + /* 1 MB for bank4 u-boot Env */ + reg = <0x04200000 0x100000>; + label = "NOR bank4 U-Boot Env"; + }; + + partition at 4300000{ + /* 1 MB for bank4 FMan ucode */ + reg = <0x04300000 0x100000>; + label = "NOR bank4 FMan ucode"; + }; + + partition at 5100000{ + /* 40MB for bank4 FIT Image */ + reg = <0x05100000 0x2800000>; + label = "NOR bank4 FIT Image"; + }; + }; + + nand at 1,0 { + compatible = "fsl,ifc-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x2 0x0 0x10000>; + + partition at 0{ + /* This location must not be altered */ + /* 1MB for u-boot Bootloader Image */ + reg = <0x0 0x00100000>; + label = "NAND U-Boot Image"; + read-only; + }; + + partition at 140000{ + /* 1MB for DTB Image */
arch/arm/dts/fsl-ls1043a-rdb.dts line 150
Quoted 10 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +10
-0+ reg = <0x00140000 0x002000>; + label = "NAND U-Boot Env"; + }; + + partition at 200000{ + /* 20MB for FIT Image */ + reg = <0x00200000 0x01400000>; + label = "NAND FIT Image"; + }; + };
Why are the partitions defined here rather than in an environment variable?
Quoted 39 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +39
-0+ clockgen: clocking at 1ee1000{ + ranges = <0x0 0x0 0x1ee1000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + sysclk: sysclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + clock-output-names = "sysclk"; + }; + + cga_pll1: pll1 at 800{ + compatible = "fsl,qoriq-core-pll-2.0"; + #clock-cells = <1>; + reg = <0x800 0x10>; + clocks = <&sysclk>; + clock-output-names = "cga-pll1", "cga-pll1-div2", + "cga-pll1-div3", "cga-pll1-div4"; + }; + + cga_pll2: pll2 at 820{ + compatible = "fsl,qoriq-core-pll-2.0"; + #clock-cells = <1>; + reg = <0x820 0x10>; + clocks = <&sysclk>; + clock-output-names = "cga-pll2", "cga-pll2-div2", + "cga-pll2-div3", "cga-pll2-div4"; + }; + + platform_clk: pll at c00{ + compatible = "fsl,qoriq-core-pll-2.0"; + #clock-cells = <1>; + reg = <0xc00 0x10>; + clocks = <&sysclk>; + clock-output-names = "platform-clk", "platform-clk-div2"; + }; + + cluster1_clk: clk0c0 at 0{ + compatible = "fsl,qoriq-core-mux-2.0";
arch/arm/dts/fsl-ls1043a-rdb.dts
Quoted 10 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +10
-0+ #clock-cells = <0>; + reg = <0x0 0x10>; + clock-names = "pll1cga", "pll1cga-div2", "pll1cga-div4", + "pll2cga", "pll2cga-div2", "pll2cga-div4"; + clocks = <&cga_pll1 0>, <&cga_pll1 1>, <&cga_pll1 2>, + <&cga_pll2 0>, <&cga_pll2 1>, <&cga_pll2 2>; + clock-output-names = "cluster1-clk"; + + }; + };
This binding is deprecated. Please don't add any more users of it (especially broken users that lack compatible, reg, etc), and more generally please use the latest version of the Linux ls1043a device tree rather than things that have never been accepted in upstream Linux.
-Scott
PATCH v2 2/4 armv8/ls1043ardb: dts: add dtb support
Quoted 253 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Thursday, November 05, 2015 7:51 AM
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Xie Shaohui-B21989; Song Wenbin-B53747; Wood Scott- B07421; Kushwaha Prabhakar-B32579
Subject: Re: [Patch V2 2/4] armv8/ls1043ardb: dts: add dtb supportQuoted 173 lines · Gong Qianyu
Reuse dts files from ls1043a linux kernel. Some parts in dts files may not be needed by U-Boot.
Signed-off-by Gong Qianyu <[email protected]>---
V2:
- New Patch.arch/arm/dts/Makefile | 1 + arch/arm/dts/fsl-ls1043a-rdb.dts | 169 +++++++++++++++++++ arch/arm/dts/fsl-ls1043a.dtsi | 346 +++++++++++++++++++++++++++++++++++++++ configs/ls1043ardb_defconfig | 2 + 4 files changed, 518 insertions(+)arch/arm/dts/Makefile index renamed from arch/arm/dts/Makefile +0
-0ddc6a05..3f3a739 100644
arch/arm/dts/Makefile +1
-0@@ -83,6 +83,7 @@ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \ ls1021a-twr.dtb dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2085a-qds.dtb \ fsl-ls2085a-rdb.dtb +dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-rdb.dtb dtb-$(CONFIG_MACH_SUN4I) += \ sun4i-a10-a1000.dtb \(quoted diff) +0
-0b/arch/arm/dts/fsl-ls1043a-
rdb.dtsnew file mode 100644 index 0000000..51b5e9farch/arm/dts/fsl-ls1043a-rdb.dts new file +140
-0@@ -0,0 +1,169 @@ +/* + * Device Tree Include file for Freescale Layerscape-1043A family SoC. + * + * Copyright (C) 2015, Freescale Semiconductor + * + * Mingkai Hu <[email protected]> + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +/dts-v1/; +/include/ "fsl-ls1043a.dtsi" + +/ { + model = "LS1043A RDB Board"; +}; + +&i2c0 { + status = "okay"; + ina220 at 40{ + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + adt7461a at 4c{ + compatible = "adt7461a"; + reg = <0x4c>; + }; + eeprom at 56{ + compatible = "at24,24c512"; + reg = <0x52>; + }; + + eeprom at 57{ + compatible = "at24,24c512"; + reg = <0x53>; + }; + + rtc at 68{ + compatible = "pericom,pt7c4338"; + reg = <0x68>; + }; +}; + +&ifc { + status = "okay"; + #address-cells = <2>; + #size-cells = <1>; + /* NOR, NAND Flashes and FPGA on board */ + ranges = <0x0 0x0 0x0 0x60000000 0x08000000 + 0x2 0x0 0x0 0x7e800000 0x00010000 + 0x3 0x0 0x0 0x7fb00000 0x00000100>; + + nor at 0,0 { + compatible = "cfi-flash"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x0 0x0 0x8000000>; + bank-width = <2>; + device-width = <1>; + + partition at 0{ + /* 1MB for RCW and PBI Image */ + reg = <0x00000000 0x00100000>; + label = "NOR bank0 RCW Image"; + }; + + partition at 100000{ + /* 1MB for bank0 u-boot Image */ + reg = <0x00100000 0x00100000>; + label = "NOR bank0 U-Boot Image"; + }; + + partition at 200000{ + /* 1 MB for bank0 u-boot Env */ + reg = <0x00200000 0x00100000>; + label = "NOR bank0 U-Boot Env"; + }; + + partition at 300000{ + /* 1MB for FMan ucode */ + reg = <0x00300000 0x00100000>; + label = "NOR bank0 FMan ucode"; + }; + + partition at 1100000{ + /* 40MB for bank0 FIT Image */ + reg = <0x01100000 0x2800000>; + label = "NOR bank0 FIT Image"; + }; + + partition at 4000000{ + /* 1MB for bank4 RCW and PBI Image */ + reg = <0x04000000 0x100000>; + label = "NOR bank4 RCW Image"; + }; + + partition at 4100000{ + /* 1MB for bank4 u-boot Image */ + reg = <0x04100000 0x100000>; + label = "NOR bank4 U-Boot Image"; + }; + + partition at 4200000{ + /* 1 MB for bank4 u-boot Env */ + reg = <0x04200000 0x100000>; + label = "NOR bank4 U-Boot Env"; + }; + + partition at 4300000{ + /* 1 MB for bank4 FMan ucode */ + reg = <0x04300000 0x100000>; + label = "NOR bank4 FMan ucode"; + }; + + partition at 5100000{ + /* 40MB for bank4 FIT Image */ + reg = <0x05100000 0x2800000>; + label = "NOR bank4 FIT Image"; + }; + }; + + nand at 1,0 { + compatible = "fsl,ifc-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x2 0x0 0x10000>; + + partition at 0{ + /* This location must not be altered */ + /* 1MB for u-boot Bootloader Image */ + reg = <0x0 0x00100000>; + label = "NAND U-Boot Image"; + read-only; + }; + + partition at 140000{ + /* 1MB for DTB Image */arch/arm/dts/fsl-ls1043a-rdb.dts line 150
Quoted 10 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +10
-0+ reg = <0x00140000 0x002000>; + label = "NAND U-Boot Env"; + }; + + partition at 200000{ + /* 20MB for FIT Image */ + reg = <0x00200000 0x01400000>; + label = "NAND FIT Image"; + }; + };Why are the partitions defined here rather than in an environment variable?
Quoted 25 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +25
-0+ clockgen: clocking at 1ee1000{ + ranges = <0x0 0x0 0x1ee1000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + sysclk: sysclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + clock-output-names = "sysclk"; + }; + + cga_pll1: pll1 at 800{ + compatible = "fsl,qoriq-core-pll-2.0"; + #clock-cells = <1>; + reg = <0x800 0x10>; + clocks = <&sysclk>; + clock-output-names = "cga-pll1", "cga-pll1-div2", + "cga-pll1-div3", "cga-pll1-div4"; + }; + + cga_pll2: pll2 at 820{ + compatible = "fsl,qoriq-core-pll-2.0"; + #clock-cells = <1>; + reg = <0x820 0x10>; + clocks = <&sysclk>;arch/arm/dts/fsl-ls1043a-rdb.dts
Quoted 10 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +10
-0+ clock-output-names = "cga-pll2", "cga-pll2-div2", + "cga-pll2-div3", "cga-pll2-div4"; + }; + + platform_clk: pll at c00{ + compatible = "fsl,qoriq-core-pll-2.0"; + #clock-cells = <1>; + reg = <0xc00 0x10>; + clocks = <&sysclk>; + clock-output-names = "platform-clk", "platform-clk-div2";
arch/arm/dts/fsl-ls1043a-rdb.dts
Quoted 7 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +7
-0+ }; + + cluster1_clk: clk0c0 at 0{ + compatible = "fsl,qoriq-core-mux-2.0"; + #clock-cells = <0>; + reg = <0x0 0x10>; + clock-names = "pll1cga", "pll1cga-div2","pll1cga-div4",
Quoted 1 line
+ "pll2cga", "pll2cga-div2",
"pll2cga-div4";
Quoted 1 line
+ clocks = <
&cga_pll10>, <&cga_pll11>, <&cga_pll12>,
Quoted 1 line
+ <
&cga_pll20>, <&cga_pll21>, <&cga_pll22>;
arch/arm/dts/fsl-ls1043a-rdb.dts
Quoted 4 lines
arch/arm/dts/fsl-ls1043a-rdb.dts new file +4
-0+ clock-output-names = "cluster1-clk"; + + }; + };
Quoted 6 lines
This binding is deprecated. Please don't add any more users of it (especially broken users that lack compatible, reg, etc), and more generally please use the latest version of the Linux ls1043a device tree rather than things that have never been accepted in upstream Linux.
-Scott
OK. I will update the dts according to the upstreaming ls1043a kernel dts. Thanks for your review.
Regards,
Qianyu
PATCH v2 3/4 armv8/ls1043aqds: add LS1043AQDS board support
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
---
V2:
- No change.
arch/arm/Kconfig | 9 + arch/arm/include/asm/arch-fsl-layerscape/fdt.h | 3 + board/freescale/ls1043aqds/Kconfig | 15 + board/freescale/ls1043aqds/MAINTAINERS | 9 + board/freescale/ls1043aqds/Makefile | 9 + board/freescale/ls1043aqds/README | 96 ++++ board/freescale/ls1043aqds/ddr.c | 131 ++++++ board/freescale/ls1043aqds/ddr.h | 60 +++ board/freescale/ls1043aqds/eth.c | 517 +++++++++++++++++++++ board/freescale/ls1043aqds/ls1043aqds.c | 333 +++++++++++++ board/freescale/ls1043aqds/ls1043aqds_pbi.cfg | 14 + board/freescale/ls1043aqds/ls1043aqds_qixis.h | 39 ++ board/freescale/ls1043aqds/ls1043aqds_rcw_nand.cfg | 7 + board/freescale/ls1043aqds/ls1043aqds_rcw_sd.cfg | 8 + configs/ls1043aqds_defconfig | 3 + configs/ls1043aqds_nand_defconfig | 4 + configs/ls1043aqds_nor_ddr3_defconfig | 2 + configs/ls1043aqds_sdcard_defconfig | 4 + include/configs/ls1043aqds.h | 390 ++++++++++++++++ 19 files changed, 1653 insertions(+)
arch/arm/Kconfig +9 -0
@@ -627,6 +627,14 @@ config TARGET_LS1021ATWR select CPU_V7 select SUPPORT_SPL +config TARGET_LS1043AQDS + bool "Support ls1043aqds" + select ARM64 + select ARMV8_MULTIENTRY + select SUPPORT_SPL + help + Support for Freescale LS1043AQDS platform. + config TARGET_LS1043ARDB bool "Support ls1043ardb" select ARM64
@@ -751,6 +759,7 @@ source "board/freescale/ls2085aqds/Kconfig" source "board/freescale/ls2085ardb/Kconfig" source "board/freescale/ls1021aqds/Kconfig" source "board/freescale/ls1021atwr/Kconfig" +source "board/freescale/ls1043aqds/Kconfig" source "board/freescale/ls1043ardb/Kconfig" source "board/freescale/mx23evk/Kconfig" source "board/freescale/mx25pdk/Kconfig"
arch/arm/include/asm/arch-fsl-layerscape/fdt.h +3 -0
@@ -11,4 +11,7 @@ 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); +#ifdef CONFIG_SYS_DPAA_FMAN +void fdt_fixup_board_enet (void *fdt); +#endif #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_FDT_H_ */
board/freescale/ls1043aqds/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_LS1043AQDS + +config SYS_BOARD + default "ls1043aqds" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "fsl-layerscape" + +config SYS_CONFIG_NAME + default "ls1043aqds" + +endif
board/freescale/ls1043aqds/MAINTAINERS new file +9 -0
@@ -0,0 +1,9 @@ +LS1043AQDS BOARD +M: Mingkai Hu <[email protected]> +S: Maintained +F: board/freescale/ls1043aqds/ +F: include/configs/ls1043aqds.h +F: configs/ls1043aqds_defconfig +F: configs/ls1043aqds_nor_ddr3_defconfig +F: configs/ls1043aqds_nand_defconfig +F: configs/ls1043aqds_sdcard_defconfig
board/freescale/ls1043aqds/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# Copyright 2015 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ddr.o +obj-y += eth.o +obj-y += ls1043aqds.o
board/freescale/ls1043aqds/README new file +96 -0
96 lines not on this page · raw message
board/freescale/ls1043aqds/ddr.c new file +131 -0
131 lines not on this page · raw message
board/freescale/ls1043aqds/ddr.h new file +60 -0
60 lines not on this page · raw message
board/freescale/ls1043aqds/eth.c new file +517 -0
517 lines not on this page · raw message
board/freescale/ls1043aqds/ls1043aqds.c new file +333 -0
333 lines not on this page · raw message
board/freescale/ls1043aqds/ls1043aqds_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/ls1043aqds/ls1043aqds_qixis.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright 2015 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __LS1043AQDS_QIXIS_H__ +#define __LS1043AQDS_QIXIS_H__ + +/* Definitions of QIXIS Registers for LS1043AQDS */ + +/* BRDCFG4[4:7] select EC1 and EC2 as a pair */ +#define BRDCFG4_EMISEL_MASK 0xe0 +#define BRDCFG4_EMISEL_SHIFT 5 + +/* SYSCLK */ +#define QIXIS_SYSCLK_66 0x0 +#define QIXIS_SYSCLK_83 0x1 +#define QIXIS_SYSCLK_100 0x2 +#define QIXIS_SYSCLK_125 0x3 +#define QIXIS_SYSCLK_133 0x4 +#define QIXIS_SYSCLK_150 0x5 +#define QIXIS_SYSCLK_160 0x6 +#define QIXIS_SYSCLK_166 0x7 +#define QIXIS_SYSCLK_64 0x8 + +/* DDRCLK */ +#define QIXIS_DDRCLK_66 0x0 +#define QIXIS_DDRCLK_100 0x1 +#define QIXIS_DDRCLK_125 0x2 +#define QIXIS_DDRCLK_133 0x3 + +/* BRDCFG2 - SD clock*/ +#define QIXIS_SDCLK1_100 0x0 +#define QIXIS_SDCLK1_125 0x1 +#define QIXIS_SDCLK1_165 0x2 +#define QIXIS_SDCLK1_100_SP 0x3 + +#endif
board/freescale/ls1043aqds/ls1043aqds_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
board/freescale/ls1043aqds/ls1043aqds_rcw_sd.cfg new file +8 -0
@@ -0,0 +1,8 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +# Enable IFC; disable QSPI +0810000f 0c000000 00000000 00000000 +14550002 80004012 60040000 61002000 +00000000 00000000 00000000 00038800 +00000000 00001100 00000096 00000001
configs/ls1043aqds_defconfig new file +3 -0
@@ -0,0 +1,3 @@ +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043AQDS=y
configs/ls1043aqds_nand_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL,NAND_BOOT" +CONFIG_ARM=y +CONFIG_TARGET_LS1043AQDS=y
configs/ls1043aqds_nor_ddr3_defconfig new file +2 -0
@@ -0,0 +1,2 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1043AQDS=y
configs/ls1043aqds_sdcard_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT" +CONFIG_ARM=y +CONFIG_TARGET_LS1043AQDS=y
include/configs/ls1043aqds.h new file +390 -0
390 lines not on this page · raw message
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 3/4 armv8/ls1043aqds: add LS1043AQDS board support
Quoted 13 lines · Gong Qianyu
arch/arm/include/asm/arch-fsl-layerscape/fdt.h +3
-0@@ -11,4 +11,7 @@ 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); +#ifdef CONFIG_SYS_DPAA_FMAN +void fdt_fixup_board_enet (void *fdt); +#endif
Quoted 1 line
#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_FDT_H_ */
Why are you ifdeffing a prototype?
-Scott
PATCH v2 4/4 armv8/ls1043aqds: dts: add dtb support
In reply to Gong QianyuReuse the dts files from ls1043a linux kernel.
---
V2:
- New Patch.
arch/arm/dts/Makefile | 3 +- arch/arm/dts/fsl-ls1043a-qds.dts | 204 +++++++++++++++++++++++++++++++++++++++ configs/ls1043aqds_defconfig | 2 + 3 files changed, 208 insertions(+), 1 deletion(-)
arch/arm/dts/Makefile +2 -1
@@ -83,7 +83,8 @@ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \ ls1021a-twr.dtb dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2085a-qds.dtb \ fsl-ls2085a-rdb.dtb -dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-rdb.dtb +dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds.dtb \ + fsl-ls1043a-rdb.dtb dtb-$(CONFIG_MACH_SUN4I) += \ sun4i-a10-a1000.dtb \
arch/arm/dts/fsl-ls1043a-qds.dts new file +204 -0
204 lines not on this page · raw message
configs/ls1043aqds_defconfig +2 -0
@@ -1,3 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4" CONFIG_ARM=y CONFIG_TARGET_LS1043AQDS=y +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds" +CONFIG_OF_CONTROL=y
Signature · 1 line
2.1.0.27.g96db324