From dc0a1a08ac98fc577b24b967d0d94a309bdb25a2 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 11 Feb 2016 13:59:46 +0100 Subject: [PATCH 1/5] arm: socfpga: Add missing CONFIG_BUILD_TARGET Add the missing CONFIG_BUILD_TARGET to get u-boot-with-spl.sfp built automatically upon running make in the source tree. Signed-off-by: Marek Vasut Cc: Dinh Nguyen Cc: Chin Liang See Cc: Denis Bakhvalov --- include/configs/socfpga_common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 8de0ab9046..0501bd110a 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -30,6 +30,9 @@ #define CONFIG_TIMESTAMP /* Print image info with timestamp */ +/* add target to build it automatically upon "make" */ +#define CONFIG_BUILD_TARGET "u-boot-with-spl.sfp" + /* * Memory configurations */ From a1d4e962cab9ba64a6ee0f70b2c0f420759bb72a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 11 Feb 2016 15:53:51 +0100 Subject: [PATCH 2/5] arm: socfpga: av_socdk: Add support for QSPI boot Add missing DT nodes to allow booting from QSPI NOR. Signed-off-by: Marek Vasut Cc: Dinh Nguyen Cc: Chin Liang See Cc: Denis Bakhvalov --- arch/arm/dts/socfpga_arria5_socdk.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/dts/socfpga_arria5_socdk.dts b/arch/arm/dts/socfpga_arria5_socdk.dts index 5933a406cb..9ac48a1683 100644 --- a/arch/arm/dts/socfpga_arria5_socdk.dts +++ b/arch/arm/dts/socfpga_arria5_socdk.dts @@ -82,8 +82,10 @@ &qspi { status = "okay"; + u-boot,dm-pre-reloc; flash0: n25q00@0 { + u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; compatible = "n25q00"; From 755ff3a38d37c895a7dc4a4d706c42514d167ae0 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 11 Feb 2016 15:54:10 +0100 Subject: [PATCH 3/5] arm: socfpga: cv_socdk: Add support for QSPI boot Add missing DT nodes to allow booting from QSPI NOR. Signed-off-by: Marek Vasut Cc: Dinh Nguyen Cc: Chin Liang See Cc: Denis Bakhvalov --- arch/arm/dts/socfpga_cyclone5_socdk.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/dts/socfpga_cyclone5_socdk.dts b/arch/arm/dts/socfpga_cyclone5_socdk.dts index a202709d60..da134354d1 100644 --- a/arch/arm/dts/socfpga_cyclone5_socdk.dts +++ b/arch/arm/dts/socfpga_cyclone5_socdk.dts @@ -84,8 +84,10 @@ &qspi { status = "okay"; + u-boot,dm-pre-reloc; flash0: n25q00@0 { + u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; compatible = "n25q00"; From 80da86642b41cad030a9dd249b91b6949f2e1977 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 11 Feb 2016 16:03:49 +0100 Subject: [PATCH 4/5] arm: socfpga: Remove bashisms from qts filter Weed out bashisms from the script. The echo -e does not work in dash, which is the default /bin/sh in debian . Signed-off-by: Marek Vasut Cc: Dinh Nguyen Cc: Chin Liang See Cc: Dalon Westergreen --- arch/arm/mach-socfpga/qts-filter.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-socfpga/qts-filter.sh b/arch/arm/mach-socfpga/qts-filter.sh index 1adfbf7384..050d6baa94 100755 --- a/arch/arm/mach-socfpga/qts-filter.sh +++ b/arch/arm/mach-socfpga/qts-filter.sh @@ -187,13 +187,13 @@ usage() { echo "$0 [soc_type] [input_qts_dir] [input_bsp_dir] [output_dir]" echo "Process QTS-generated headers into U-Boot compatible ones." echo "" - echo -e " soc_type\t-\tType of SoC, either 'cyclone5' or 'arria5'." - echo -e " input_qts_dir\t-\tDirectory with compiled Quartus project" - echo -e "\t\t\t\tand containing the Quartus project file (QPF)." - echo -e " input_bsp_dir\t-\tDirectory with generated bsp containing" - echo -e "\t\t\t\tthe settings.bsp file." - echo -e " output_dir\t-\tDirectory to store the U-Boot compatible" - echo -e "\t\t\t\theaders." + echo " soc_type - Type of SoC, either 'cyclone5' or 'arria5'." + echo " input_qts_dir - Directory with compiled Quartus project" + echo " and containing the Quartus project file (QPF)." + echo " input_bsp_dir - Directory with generated bsp containing" + echo " the settings.bsp file." + echo " output_dir - Directory to store the U-Boot compatible" + echo " headers." echo "" } From e6e34ca3ad43eae88faccb01282385416d23e6e7 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 11 Feb 2016 16:36:43 +0100 Subject: [PATCH 5/5] arm: socfpga: Fix ethernet reset handling The following patch caused cpu_eth_init() to not be called anymore for DM-capable boards: commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d Date: Sun Jan 17 14:51:56 2016 -0700 net: Don't call board/cpu_eth_init() with driver model This breaks ethernet on SoCFPGA, since we use that function to un-reset the ethernet blocks. Invoke the ethernet reset function from arch_misc_init() instead to fix the breakage. Signed-off-by: Marek Vasut Cc: Dinh Nguyen Cc: Chin Liang See Cc: Denis Bakhvalov --- arch/arm/mach-socfpga/misc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c index 9b43b92f5b..ce3ff0acc4 100644 --- a/arch/arm/mach-socfpga/misc.c +++ b/arch/arm/mach-socfpga/misc.c @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int of_reset_id) socfpga_per_reset(reset, 0); } -int cpu_eth_init(bd_t *bis) +static int socfpga_eth_reset(void) { const void *fdt = gd->fdt_blob; struct fdtdec_phandle_args args; @@ -137,6 +137,11 @@ int cpu_eth_init(bd_t *bis) return 0; } +#else +static int socfpga_eth_reset(void) +{ + return 0 +}; #endif struct { @@ -232,7 +237,7 @@ int arch_misc_init(void) setenv("bootmode", bsel_str[bsel].mode); if (fpga_id >= 0) setenv("fpgatype", socfpga_fpga_model[fpga_id].var); - return 0; + return socfpga_eth_reset(); } #endif