[U-Boot] [PATCH 1/6] arm: socfpga: de0_nano: Zap VIRTUAL_TARGET

There is no VT for this board, so remove this incorrect macro.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com --- include/configs/socfpga_de0_nano_soc.h | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/include/configs/socfpga_de0_nano_soc.h b/include/configs/socfpga_de0_nano_soc.h index d27aa9b..6007895 100644 --- a/include/configs/socfpga_de0_nano_soc.h +++ b/include/configs/socfpga_de0_nano_soc.h @@ -37,11 +37,7 @@ #define CONFIG_BOOTDELAY 3 #define CONFIG_BOOTFILE "fitImage" #define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE) -#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET -#define CONFIG_BOOTCOMMAND "run ramboot" -#else #define CONFIG_BOOTCOMMAND "run mmcload; run mmcboot" -#endif #define CONFIG_LOADADDR 0x01000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR

There is no VT for this board, so remove this incorrect macro.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com --- include/configs/socfpga_sockit.h | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/include/configs/socfpga_sockit.h b/include/configs/socfpga_sockit.h index eefe01c..924de3f 100644 --- a/include/configs/socfpga_sockit.h +++ b/include/configs/socfpga_sockit.h @@ -37,11 +37,7 @@ #define CONFIG_BOOTDELAY 3 #define CONFIG_BOOTFILE "fitImage" #define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE) -#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET -#define CONFIG_BOOTCOMMAND "run ramboot" -#else #define CONFIG_BOOTCOMMAND "run mmcload; run mmcboot" -#endif #define CONFIG_LOADADDR 0x01000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR

On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
There is no VT for this board, so remove this incorrect macro.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_sockit.h | 4 ---- 1 file changed, 4 deletions(-)
Reviewed-by: Chin Liang See clsee@altera.com
Thanks Chin Liang

We already have the CONFIG_SYS_VENDOR variable, which defines the manufacturer of the board. The value in CONFIG_G_DNL_MANUFACTURER is just a duplicity, so switch it to reuse CONFIG_SYS_VENDOR .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com --- include/configs/socfpga_arria5_socdk.h | 3 --- include/configs/socfpga_common.h | 2 +- include/configs/socfpga_cyclone5_socdk.h | 3 --- include/configs/socfpga_de0_nano_soc.h | 3 --- include/configs/socfpga_mcvevk.h | 3 --- include/configs/socfpga_sockit.h | 3 --- include/configs/socfpga_socrates.h | 3 --- 7 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index d2411e6..a036856 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -55,9 +55,6 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
-/* USB */ -#define CONFIG_G_DNL_MANUFACTURER "Altera" - /* Extra Environment */ #define CONFIG_HOSTNAME socfpga_arria5
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index b0bc689..4b2d246 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -262,7 +262,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_G_DNL_UMS_VENDOR_NUM CONFIG_G_DNL_VENDOR_NUM #define CONFIG_G_DNL_UMS_PRODUCT_NUM CONFIG_G_DNL_PRODUCT_NUM #ifndef CONFIG_G_DNL_MANUFACTURER -#define CONFIG_G_DNL_MANUFACTURER "Altera" +#define CONFIG_G_DNL_MANUFACTURER CONFIG_SYS_VENDOR #endif #endif
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 76d29a3..4e38d5e 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -55,9 +55,6 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
-/* USB */ -#define CONFIG_G_DNL_MANUFACTURER "Altera" - /* Extra Environment */ #define CONFIG_HOSTNAME socfpga_cyclone5
diff --git a/include/configs/socfpga_de0_nano_soc.h b/include/configs/socfpga_de0_nano_soc.h index 6007895..e06ca7b 100644 --- a/include/configs/socfpga_de0_nano_soc.h +++ b/include/configs/socfpga_de0_nano_soc.h @@ -51,9 +51,6 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
-/* USB */ -#define CONFIG_G_DNL_MANUFACTURER "Terasic" - /* Extra Environment */ #define CONFIG_HOSTNAME socfpga_de0_nano_soc
diff --git a/include/configs/socfpga_mcvevk.h b/include/configs/socfpga_mcvevk.h index b2c1f75..5fc4edb 100644 --- a/include/configs/socfpga_mcvevk.h +++ b/include/configs/socfpga_mcvevk.h @@ -48,9 +48,6 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
-/* USB */ -#define CONFIG_G_DNL_MANUFACTURER "DENX" - /* Extra Environment */ #define CONFIG_HOSTNAME mcvevk
diff --git a/include/configs/socfpga_sockit.h b/include/configs/socfpga_sockit.h index 924de3f..d5e69fd 100644 --- a/include/configs/socfpga_sockit.h +++ b/include/configs/socfpga_sockit.h @@ -51,9 +51,6 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
-/* USB */ -#define CONFIG_G_DNL_MANUFACTURER "Terasic" - /* Extra Environment */ #define CONFIG_HOSTNAME socfpga_sockit
diff --git a/include/configs/socfpga_socrates.h b/include/configs/socfpga_socrates.h index 1b0888f..f11c89c 100644 --- a/include/configs/socfpga_socrates.h +++ b/include/configs/socfpga_socrates.h @@ -51,9 +51,6 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
-/* USB */ -#define CONFIG_G_DNL_MANUFACTURER "EBV" - /* Extra Environment */ #define CONFIG_HOSTNAME socfpga_socrates

On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
We already have the CONFIG_SYS_VENDOR variable, which defines the manufacturer of the board. The value in CONFIG_G_DNL_MANUFACTURER is just a duplicity, so switch it to reuse CONFIG_SYS_VENDOR .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_arria5_socdk.h | 3 --- include/configs/socfpga_common.h | 2 +- include/configs/socfpga_cyclone5_socdk.h | 3 --- include/configs/socfpga_de0_nano_soc.h | 3 --- include/configs/socfpga_mcvevk.h | 3 --- include/configs/socfpga_sockit.h | 3 --- include/configs/socfpga_socrates.h | 3 --- 7 files changed, 1 insertion(+), 19 deletions(-)
Acked-by: Chin Liang See clsee@altera.com
Thanks Chin Liang

We already have the CONFIG_SYS_BOARD variable, which defines the name of the board. The value in CONFIG_HOSTNAME is exactly the same and is thus just a duplicity, so switch it to reuse CONFIG_SYS_BOARD .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com --- include/configs/socfpga_arria5_socdk.h | 2 -- include/configs/socfpga_common.h | 4 ++++ include/configs/socfpga_cyclone5_socdk.h | 2 -- include/configs/socfpga_de0_nano_soc.h | 2 -- include/configs/socfpga_mcvevk.h | 2 -- include/configs/socfpga_sockit.h | 2 -- include/configs/socfpga_socrates.h | 2 -- include/configs/socfpga_sr1500.h | 3 --- 8 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index a036856..3d5665d 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -56,8 +56,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME socfpga_arria5 - #define CONFIG_EXTRA_ENV_SETTINGS \ "verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 4b2d246..f74c758 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -69,6 +69,10 @@ #define CONFIG_CMDLINE_EDITING /* Command history etc */ #define CONFIG_SYS_HUSH_PARSER
+#ifndef CONFIG_SYS_HOSTNAME +#define CONFIG_SYS_HOSTNAME CONFIG_SYS_BOARD +#endif + /* * Cache */ diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 4e38d5e..d2efdda 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -56,8 +56,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME socfpga_cyclone5 - #define CONFIG_EXTRA_ENV_SETTINGS \ "verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/socfpga_de0_nano_soc.h b/include/configs/socfpga_de0_nano_soc.h index e06ca7b..959e3af 100644 --- a/include/configs/socfpga_de0_nano_soc.h +++ b/include/configs/socfpga_de0_nano_soc.h @@ -52,8 +52,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME socfpga_de0_nano_soc - #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \ diff --git a/include/configs/socfpga_mcvevk.h b/include/configs/socfpga_mcvevk.h index 5fc4edb..cd63faf 100644 --- a/include/configs/socfpga_mcvevk.h +++ b/include/configs/socfpga_mcvevk.h @@ -49,8 +49,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME mcvevk - #define CONFIG_EXTRA_ENV_SETTINGS \ "consdev=ttyS0\0" \ "baudrate=115200\0" \ diff --git a/include/configs/socfpga_sockit.h b/include/configs/socfpga_sockit.h index d5e69fd..6cbe367 100644 --- a/include/configs/socfpga_sockit.h +++ b/include/configs/socfpga_sockit.h @@ -52,8 +52,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME socfpga_sockit - #define CONFIG_EXTRA_ENV_SETTINGS \ "verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/socfpga_socrates.h b/include/configs/socfpga_socrates.h index f11c89c..1d88f4f 100644 --- a/include/configs/socfpga_socrates.h +++ b/include/configs/socfpga_socrates.h @@ -52,8 +52,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME socfpga_socrates - #define CONFIG_EXTRA_ENV_SETTINGS \ "verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/socfpga_sr1500.h b/include/configs/socfpga_sr1500.h index bccb235..5bd2956 100644 --- a/include/configs/socfpga_sr1500.h +++ b/include/configs/socfpga_sr1500.h @@ -53,9 +53,6 @@ #define CONFIG_PHY_MARVELL #define PHY_ANEG_TIMEOUT 8000
-/* Extra Environment */ -#define CONFIG_HOSTNAME sr1500 - #define CONFIG_EXTRA_ENV_SETTINGS \ "verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \

On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
We already have the CONFIG_SYS_BOARD variable, which defines the name of the board. The value in CONFIG_HOSTNAME is exactly the same and is thus just a duplicity, so switch it to reuse CONFIG_SYS_BOARD .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_arria5_socdk.h | 2 -- include/configs/socfpga_common.h | 4 ++++ include/configs/socfpga_cyclone5_socdk.h | 2 -- include/configs/socfpga_de0_nano_soc.h | 2 -- include/configs/socfpga_mcvevk.h | 2 -- include/configs/socfpga_sockit.h | 2 -- include/configs/socfpga_socrates.h | 2 -- include/configs/socfpga_sr1500.h | 3 --- 8 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index a036856..3d5665d 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -56,8 +56,6 @@ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
/* Extra Environment */ -#define CONFIG_HOSTNAME socfpga_arria5
#define CONFIG_EXTRA_ENV_SETTINGS \ "verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 4b2d246..f74c758 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -69,6 +69,10 @@ #define CONFIG_CMDLINE_EDITING /* Command history etc */ #define CONFIG_SYS_HUSH_PARSER
+#ifndef CONFIG_SYS_HOSTNAME +#define CONFIG_SYS_HOSTNAME CONFIG_SYS_BOARD +#endif
I saw the change of hostname for socdk would be "socfpga_cyclone5" to "cyclone5-socdk" and same for other board. Wonder any impact on this change?
Thanks Chin Liang

On Monday, December 07, 2015 at 07:25:31 AM, Chin Liang See wrote:
On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
We already have the CONFIG_SYS_BOARD variable, which defines the name of the board. The value in CONFIG_HOSTNAME is exactly the same and is thus just a duplicity, so switch it to reuse CONFIG_SYS_BOARD .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_arria5_socdk.h | 2 -- include/configs/socfpga_common.h | 4 ++++ include/configs/socfpga_cyclone5_socdk.h | 2 -- include/configs/socfpga_de0_nano_soc.h | 2 -- include/configs/socfpga_mcvevk.h | 2 -- include/configs/socfpga_sockit.h | 2 -- include/configs/socfpga_socrates.h | 2 -- include/configs/socfpga_sr1500.h | 3 --- 8 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index a036856..3d5665d 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -56,8 +56,6 @@
#define CONFIG_ENV_OFFSET 512 /* just after
the MBR */
/* Extra Environment */
-#define CONFIG_HOSTNAME socfpga_arria5
#define CONFIG_EXTRA_ENV_SETTINGS \
"verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 4b2d246..f74c758 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -69,6 +69,10 @@
#define CONFIG_CMDLINE_EDITING /* Command
history etc */
#define CONFIG_SYS_HUSH_PARSER
+#ifndef CONFIG_SYS_HOSTNAME +#define CONFIG_SYS_HOSTNAME CONFIG_SYS_BOARD +#endif
I saw the change of hostname for socdk would be "socfpga_cyclone5" to "cyclone5-socdk" and same for other board. Wonder any impact on this change?
It should have no impact, unless you're using the hostname in your scripts for something. You would have no way to tell apart the cyclone5 boards with the old hostname though, since socfpga_cyclone5 is too generic. In case this breaks some script of yours, setenv hostname socfpga_cyclone5 would fix it.
Best regards, Marek Vasut

On Mon, 2015-12-07 at 09:36 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 07:25:31 AM, Chin Liang See wrote:
On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
We already have the CONFIG_SYS_BOARD variable, which defines the name of the board. The value in CONFIG_HOSTNAME is exactly the same and is thus just a duplicity, so switch it to reuse CONFIG_SYS_BOARD .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_arria5_socdk.h | 2 -- include/configs/socfpga_common.h | 4 ++++ include/configs/socfpga_cyclone5_socdk.h | 2 -- include/configs/socfpga_de0_nano_soc.h | 2 -- include/configs/socfpga_mcvevk.h | 2 -- include/configs/socfpga_sockit.h | 2 -- include/configs/socfpga_socrates.h | 2 -- include/configs/socfpga_sr1500.h | 3 --- 8 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index a036856..3d5665d 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -56,8 +56,6 @@
#define CONFIG_ENV_OFFSET 512 /* just after
the MBR */
/* Extra Environment */
-#define CONFIG_HOSTNAME socfpga_arria5
#define CONFIG_EXTRA_ENV_SETTINGS \
"verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 4b2d246..f74c758 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -69,6 +69,10 @@
#define CONFIG_CMDLINE_EDITING /* Command
history etc */
#define CONFIG_SYS_HUSH_PARSER
+#ifndef CONFIG_SYS_HOSTNAME +#define CONFIG_SYS_HOSTNAME CONFIG_SYS_BOARD +#endif
I saw the change of hostname for socdk would be "socfpga_cyclone5" to "cyclone5-socdk" and same for other board. Wonder any impact on this change?
It should have no impact, unless you're using the hostname in your scripts for something. You would have no way to tell apart the cyclone5 boards with the old hostname though, since socfpga_cyclone5 is too generic. In case this breaks some script of yours, setenv hostname socfpga_cyclone5 would fix it.
I grep previously and its not used. But will take note if any side effect noticed.
Thanks Chin Liang
Best regards, Marek Vasut

On Monday, December 07, 2015 at 11:01:24 AM, Chin Liang See wrote:
On Mon, 2015-12-07 at 09:36 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 07:25:31 AM, Chin Liang See wrote:
On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
We already have the CONFIG_SYS_BOARD variable, which defines the name of the board. The value in CONFIG_HOSTNAME is exactly the same and is thus just a duplicity, so switch it to reuse CONFIG_SYS_BOARD .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_arria5_socdk.h | 2 -- include/configs/socfpga_common.h | 4 ++++ include/configs/socfpga_cyclone5_socdk.h | 2 -- include/configs/socfpga_de0_nano_soc.h | 2 -- include/configs/socfpga_mcvevk.h | 2 -- include/configs/socfpga_sockit.h | 2 -- include/configs/socfpga_socrates.h | 2 -- include/configs/socfpga_sr1500.h | 3 --- 8 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index a036856..3d5665d 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -56,8 +56,6 @@
#define CONFIG_ENV_OFFSET 512 /* just
after
the MBR */
/* Extra Environment */
-#define CONFIG_HOSTNAME socfpga_arria5
#define CONFIG_EXTRA_ENV_SETTINGS \
"verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 4b2d246..f74c758 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -69,6 +69,10 @@
#define CONFIG_CMDLINE_EDITING /* Command
history etc */
#define CONFIG_SYS_HUSH_PARSER
+#ifndef CONFIG_SYS_HOSTNAME +#define CONFIG_SYS_HOSTNAME CONFIG_SYS_BOARD +#endif
I saw the change of hostname for socdk would be "socfpga_cyclone5" to "cyclone5-socdk" and same for other board. Wonder any impact on this change?
It should have no impact, unless you're using the hostname in your scripts for something. You would have no way to tell apart the cyclone5 boards with the old hostname though, since socfpga_cyclone5 is too generic. In case this breaks some script of yours, setenv hostname socfpga_cyclone5 would fix it.
I grep previously and its not used. But will take note if any side effect noticed.
OK, thanks

On Mon, 2015-12-07 at 13:01 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 11:01:24 AM, Chin Liang See wrote:
On Mon, 2015-12-07 at 09:36 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 07:25:31 AM, Chin Liang See wrote:
On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
We already have the CONFIG_SYS_BOARD variable, which defines the name of the board. The value in CONFIG_HOSTNAME is exactly the same and is thus just a duplicity, so switch it to reuse CONFIG_SYS_BOARD .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_arria5_socdk.h | 2 -- include/configs/socfpga_common.h | 4 ++++ include/configs/socfpga_cyclone5_socdk.h | 2 -- include/configs/socfpga_de0_nano_soc.h | 2 -- include/configs/socfpga_mcvevk.h | 2 -- include/configs/socfpga_sockit.h | 2 -- include/configs/socfpga_socrates.h | 2 -- include/configs/socfpga_sr1500.h | 3 --- 8 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index a036856..3d5665d 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -56,8 +56,6 @@
#define CONFIG_ENV_OFFSET 512 /* just
after
the MBR */
/* Extra Environment */
-#define CONFIG_HOSTNAME socfpga_arria5
#define CONFIG_EXTRA_ENV_SETTINGS \
"verify=n\0" \ "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 4b2d246..f74c758 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -69,6 +69,10 @@
#define CONFIG_CMDLINE_EDITING /* Command
history etc */
#define CONFIG_SYS_HUSH_PARSER
+#ifndef CONFIG_SYS_HOSTNAME +#define CONFIG_SYS_HOSTNAME CONFIG_SYS_BOARD +#endif
I saw the change of hostname for socdk would be "socfpga_cyclone5" to "cyclone5-socdk" and same for other board. Wonder any impact on this change?
It should have no impact, unless you're using the hostname in your scripts for something. You would have no way to tell apart the cyclone5 boards with the old hostname though, since socfpga_cyclone5 is too generic. In case this breaks some script of yours, setenv hostname socfpga_cyclone5 would fix it.
I grep previously and its not used. But will take note if any side effect noticed.
OK, thanks
Acked-by: Chin Liang See clsee@altera.com
Thanks Chin Liang

The SoCFPGA has reached a point where every single board code become the same, since each and every single board is probed equally from OF. Move the common board code into arch/arm/mach-socfpga/ .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com --- arch/arm/mach-socfpga/Makefile | 2 +- arch/arm/mach-socfpga/board.c | 64 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-socfpga/board.c
diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile index 316b326..5cf9e23 100644 --- a/arch/arm/mach-socfpga/Makefile +++ b/arch/arm/mach-socfpga/Makefile @@ -8,7 +8,7 @@ #
obj-y += misc.o timer.o reset_manager.o system_manager.o clock_manager.o \ - fpga_manager.o scan_manager.o + fpga_manager.o scan_manager.o board.o obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
# QTS-generated config file wrappers diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c @@ -0,0 +1,64 @@ +/* + * Altera SoCFPGA common board code + * + * Copyright (C) 2015 Marek Vasut marex@denx.de + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <errno.h> +#include <asm/arch/reset_manager.h> +#include <asm/io.h> + +#include <usb.h> +#include <usb/dwc2_udc.h> + +DECLARE_GLOBAL_DATA_PTR; + +void s_init(void) {} + +/* + * Miscellaneous platform dependent initialisations + */ +int board_init(void) +{ + /* Address of boot parameters for ATAG (if ATAG is used) */ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + + return 0; +} + +#ifdef CONFIG_USB_GADGET +struct dwc2_plat_otg_data socfpga_otg_data = { + .usb_gusbcfg = 0x1417, +}; + +int board_usb_init(int index, enum usb_init_type init) +{ + int node[2], count; + fdt_addr_t addr; + + count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc", + COMPAT_ALTERA_SOCFPGA_DWC2USB, + node, 2); + if (count <= 0) /* No controller found. */ + return 0; + + addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg"); + if (addr == FDT_ADDR_T_NONE) { + printf("UDC Controller has no 'reg' property!\n"); + return -EINVAL; + } + + /* Patch the address from OF into the controller pdata. */ + socfpga_otg_data.regs_otg = addr; + + return dwc2_udc_probe(&socfpga_otg_data); +} + +int g_dnl_board_usb_cable_connected(void) +{ + return 1; +} +#endif

On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
The SoCFPGA has reached a point where every single board code become the same, since each and every single board is probed equally from OF. Move the common board code into arch/arm/mach-socfpga/ .
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
arch/arm/mach-socfpga/Makefile | 2 +- arch/arm/mach-socfpga/board.c | 64 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-socfpga/board.c
diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach -socfpga/Makefile index 316b326..5cf9e23 100644 --- a/arch/arm/mach-socfpga/Makefile +++ b/arch/arm/mach-socfpga/Makefile @@ -8,7 +8,7 @@ #
obj-y += misc.o timer.o reset_manager.o system_manager.o clock_manager.o \
fpga_manager.o scan_manager.o
fpga_manager.o scan_manager.o board.o
obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
# QTS-generated config file wrappers diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach -socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
@@ -0,0 +1,64 @@ +/*
- Altera SoCFPGA common board code
- Copyright (C) 2015 Marek Vasut marex@denx.de
- SPDX-License-Identifier: GPL-2.0+
- */
+#include <common.h> +#include <errno.h> +#include <asm/arch/reset_manager.h> +#include <asm/io.h>
+#include <usb.h> +#include <usb/dwc2_udc.h>
+DECLARE_GLOBAL_DATA_PTR;
+void s_init(void) {}
+/*
- Miscellaneous platform dependent initialisations
- */
+int board_init(void)
I am thinking we can skip the board_init where it located at original board folder. If user has unique board specific initialization, they can still do it there.
Thanks Chin Liang

On Monday, December 07, 2015 at 01:53:48 PM, Chin Liang See wrote:
[...]
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach -socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
misc.c is bloated with random crap already, I would like to keep things orderly a little. Let's keep the board code and platform code separated.
@@ -0,0 +1,64 @@ +/*
- Altera SoCFPGA common board code
- Copyright (C) 2015 Marek Vasut marex@denx.de
- SPDX-License-Identifier: GPL-2.0+
- */
+#include <common.h> +#include <errno.h> +#include <asm/arch/reset_manager.h> +#include <asm/io.h>
+#include <usb.h> +#include <usb/dwc2_udc.h>
+DECLARE_GLOBAL_DATA_PTR;
+void s_init(void) {}
+/*
- Miscellaneous platform dependent initialisations
- */
+int board_init(void)
I am thinking we can skip the board_init where it located at original board folder. If user has unique board specific initialization, they can still do it there.
See my reply to 6/6 .
Best regards, Marek Vasut

On Mon, 2015-12-07 at 14:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 01:53:48 PM, Chin Liang See wrote:
[...]
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach -socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
misc.c is bloated with random crap already, I would like to keep things orderly a little. Let's keep the board code and platform code separated.
Initial thinking misc.c should be as lean as possible but that seems not today. Can consider split them out per features such as usb.c ethernet.c.
Thanks Chin Liang
@@ -0,0 +1,64 @@ +/*
- Altera SoCFPGA common board code
- Copyright (C) 2015 Marek Vasut marex@denx.de
- SPDX-License-Identifier: GPL-2.0+
- */
+#include <common.h> +#include <errno.h> +#include <asm/arch/reset_manager.h> +#include <asm/io.h>
+#include <usb.h> +#include <usb/dwc2_udc.h>
+DECLARE_GLOBAL_DATA_PTR;
+void s_init(void) {}
+/*
- Miscellaneous platform dependent initialisations
- */
+int board_init(void)
I am thinking we can skip the board_init where it located at original board folder. If user has unique board specific initialization, they can still do it there.
See my reply to 6/6 .
Best regards, Marek Vasut

On Monday, December 07, 2015 at 02:32:04 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 14:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 01:53:48 PM, Chin Liang See wrote:
[...]
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach -socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
misc.c is bloated with random crap already, I would like to keep things orderly a little. Let's keep the board code and platform code separated.
Initial thinking misc.c should be as lean as possible but that seems not today. Can consider split them out per features such as usb.c ethernet.c.
There is no ethernet/usb... anything in misc.c and there shouldn't be. All of this stuff is (or should be) probed from OF :-)
Best regards, Marek Vasut

On Mon, 2015-12-07 at 15:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 02:32:04 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 14:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 01:53:48 PM, Chin Liang See wrote:
[...]
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach -socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
misc.c is bloated with random crap already, I would like to keep things orderly a little. Let's keep the board code and platform code separated.
Initial thinking misc.c should be as lean as possible but that seems not today. Can consider split them out per features such as usb.c ethernet.c.
There is no ethernet/usb... anything in misc.c and there shouldn't be. All of this stuff is (or should be) probed from OF :-)
Looking at misc.c, yup, they are specific to socfpga such as system manager emac registers. Till then, good from me
Acked-by: Chin Liang See clsee@altera.com
Thanks Chin Liang
Best regards, Marek Vasut

On Monday, December 07, 2015 at 03:29:16 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 15:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 02:32:04 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 14:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 01:53:48 PM, Chin Liang See wrote:
[...]
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach -socfpga/board.c new file mode 100644 index 0000000..a41d089 --- /dev/null +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
misc.c is bloated with random crap already, I would like to keep things orderly a little. Let's keep the board code and platform code separated.
Initial thinking misc.c should be as lean as possible but that seems not today. Can consider split them out per features such as usb.c ethernet.c.
There is no ethernet/usb... anything in misc.c and there shouldn't be. All of this stuff is (or should be) probed from OF :-)
Looking at misc.c, yup, they are specific to socfpga such as system manager emac registers. Till then, good from me
The cpu_eth_init() could use improvement, but we don't support generic reset handling yet I believe. That's the only thing which is obviously visible there, which could be improved.
The other thing which might use improvement is the FPGA registration, I suspect that might recycle the bindings from current linux 4.4.x at some point and move to DT as well.
Best regards, Marek Vasut

On Mon, 2015-12-07 at 15:37 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 03:29:16 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 15:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 02:32:04 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 14:23 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 01:53:48 PM, Chin Liang See wrote:
[...]
> diff --git a/arch/arm/mach-socfpga/board.c > b/arch/arm/mach > -socfpga/board.c > new file mode 100644 > index 0000000..a41d089 > --- /dev/null > +++ b/arch/arm/mach-socfpga/board.c
I am thinking this can go into misc.c instead new file.
misc.c is bloated with random crap already, I would like to keep things orderly a little. Let's keep the board code and platform code separated.
Initial thinking misc.c should be as lean as possible but that seems not today. Can consider split them out per features such as usb.c ethernet.c.
There is no ethernet/usb... anything in misc.c and there shouldn't be. All of this stuff is (or should be) probed from OF :-)
Looking at misc.c, yup, they are specific to socfpga such as system manager emac registers. Till then, good from me
The cpu_eth_init() could use improvement, but we don't support generic reset handling yet I believe. That's the only thing which is obviously visible there, which could be improved.
The other thing which might use improvement is the FPGA registration, I suspect that might recycle the bindings from current linux 4.4.x at some point and move to DT as well.
Nice, looking forward then :)
To further clean-up, I am thinking we can move do_bridge to reset_manager.c too. I can do this if it sound good to you.
Thanks Chin Liang
Best regards, Marek Vasut

On Monday, December 07, 2015 at 03:56:01 PM, Chin Liang See wrote: [...]
The cpu_eth_init() could use improvement, but we don't support generic reset handling yet I believe. That's the only thing which is obviously visible there, which could be improved.
The other thing which might use improvement is the FPGA registration, I suspect that might recycle the bindings from current linux 4.4.x at some point and move to DT as well.
Nice, looking forward then :)
To further clean-up, I am thinking we can move do_bridge to reset_manager.c too. I can do this if it sound good to you.
It's not reset-manager specific though, is it ?
Best regards, Marek Vasut

On Mon, 2015-12-07 at 18:46 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 03:56:01 PM, Chin Liang See wrote: [...]
The cpu_eth_init() could use improvement, but we don't support generic reset handling yet I believe. That's the only thing which is obviously visible there, which could be improved.
The other thing which might use improvement is the FPGA registration, I suspect that might recycle the bindings from current linux 4.4.x at some point and move to DT as well.
Nice, looking forward then :)
To further clean-up, I am thinking we can move do_bridge to reset_manager.c too. I can do this if it sound good to you.
It's not reset-manager specific though, is it ?
All bridges are still release through reset manager except the fpga2sdram. Since we bridge assert at reset manager, consolidating these deassert function will make misc.c cleaner.
Thanks Chin Liang
Best regards, Marek Vasut

On Tuesday, December 08, 2015 at 01:34:53 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 18:46 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 03:56:01 PM, Chin Liang See wrote: [...]
The cpu_eth_init() could use improvement, but we don't support generic reset handling yet I believe. That's the only thing which is obviously visible there, which could be improved.
The other thing which might use improvement is the FPGA registration, I suspect that might recycle the bindings from current linux 4.4.x at some point and move to DT as well.
Nice, looking forward then :)
To further clean-up, I am thinking we can move do_bridge to reset_manager.c too. I can do this if it sound good to you.
It's not reset-manager specific though, is it ?
All bridges are still release through reset manager except the fpga2sdram. Since we bridge assert at reset manager, consolidating these deassert function will make misc.c cleaner.
OK, it might be better if we discuss this over a patch, so let's see how that looks.
Best regards, Marek Vasut

On Tue, 2015-12-08 at 13:57 +0100, Marek Vasut wrote:
On Tuesday, December 08, 2015 at 01:34:53 PM, Chin Liang See wrote:
On Mon, 2015-12-07 at 18:46 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 03:56:01 PM, Chin Liang See wrote: [...]
The cpu_eth_init() could use improvement, but we don't support generic reset handling yet I believe. That's the only thing which is obviously visible there, which could be improved.
The other thing which might use improvement is the FPGA registration, I suspect that might recycle the bindings from current linux 4.4.x at some point and move to DT as well.
Nice, looking forward then :)
To further clean-up, I am thinking we can move do_bridge to reset_manager.c too. I can do this if it sound good to you.
It's not reset-manager specific though, is it ?
All bridges are still release through reset manager except the fpga2sdram. Since we bridge assert at reset manager, consolidating these deassert function will make misc.c cleaner.
OK, it might be better if we discuss this over a patch, so let's see how that looks.
Sure
Thanks Chin Liang
Best regards, Marek Vasut

Drop all the common board code, since it is not completely useless.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com --- board/altera/arria5-socdk/socfpga.c | 56 ----------------------------------- board/altera/cyclone5-socdk/socfpga.c | 56 ----------------------------------- board/denx/mcvevk/socfpga.c | 56 ----------------------------------- board/ebv/socrates/socfpga.c | 56 ----------------------------------- board/sr1500/socfpga.c | 17 ----------- board/terasic/de0-nano-soc/socfpga.c | 16 ---------- board/terasic/sockit/socfpga.c | 56 ----------------------------------- 7 files changed, 313 deletions(-)
diff --git a/board/altera/arria5-socdk/socfpga.c b/board/altera/arria5-socdk/socfpga.c index 449f3b5..97fb902 100644 --- a/board/altera/arria5-socdk/socfpga.c +++ b/board/altera/arria5-socdk/socfpga.c @@ -3,60 +3,4 @@ * * SPDX-License-Identifier: GPL-2.0+ */ - #include <common.h> -#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h> - -#include <usb.h> -#include <usb/dwc2_udc.h> - -DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} - -#ifdef CONFIG_USB_GADGET -struct dwc2_plat_otg_data socfpga_otg_data = { - .usb_gusbcfg = 0x1417, -}; - -int board_usb_init(int index, enum usb_init_type init) -{ - int node[2], count; - fdt_addr_t addr; - - count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc", - COMPAT_ALTERA_SOCFPGA_DWC2USB, - node, 2); - if (count <= 0) /* No controller found. */ - return 0; - - addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg"); - if (addr == FDT_ADDR_T_NONE) { - printf("UDC Controller has no 'reg' property!\n"); - return -EINVAL; - } - - /* Patch the address from OF into the controller pdata. */ - socfpga_otg_data.regs_otg = addr; - - return dwc2_udc_probe(&socfpga_otg_data); -} - -int g_dnl_board_usb_cable_connected(void) -{ - return 1; -} -#endif diff --git a/board/altera/cyclone5-socdk/socfpga.c b/board/altera/cyclone5-socdk/socfpga.c index 449f3b5..97fb902 100644 --- a/board/altera/cyclone5-socdk/socfpga.c +++ b/board/altera/cyclone5-socdk/socfpga.c @@ -3,60 +3,4 @@ * * SPDX-License-Identifier: GPL-2.0+ */ - #include <common.h> -#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h> - -#include <usb.h> -#include <usb/dwc2_udc.h> - -DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} - -#ifdef CONFIG_USB_GADGET -struct dwc2_plat_otg_data socfpga_otg_data = { - .usb_gusbcfg = 0x1417, -}; - -int board_usb_init(int index, enum usb_init_type init) -{ - int node[2], count; - fdt_addr_t addr; - - count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc", - COMPAT_ALTERA_SOCFPGA_DWC2USB, - node, 2); - if (count <= 0) /* No controller found. */ - return 0; - - addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg"); - if (addr == FDT_ADDR_T_NONE) { - printf("UDC Controller has no 'reg' property!\n"); - return -EINVAL; - } - - /* Patch the address from OF into the controller pdata. */ - socfpga_otg_data.regs_otg = addr; - - return dwc2_udc_probe(&socfpga_otg_data); -} - -int g_dnl_board_usb_cable_connected(void) -{ - return 1; -} -#endif diff --git a/board/denx/mcvevk/socfpga.c b/board/denx/mcvevk/socfpga.c index d77d7ad..6be58f0 100644 --- a/board/denx/mcvevk/socfpga.c +++ b/board/denx/mcvevk/socfpga.c @@ -3,60 +3,4 @@ * * SPDX-License-Identifier: GPL-2.0+ */ - #include <common.h> -#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h> - -#include <usb.h> -#include <usb/dwc2_udc.h> - -DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} - -#ifdef CONFIG_USB_GADGET -struct dwc2_plat_otg_data socfpga_otg_data = { - .usb_gusbcfg = 0x1417, -}; - -int board_usb_init(int index, enum usb_init_type init) -{ - int node[2], count; - fdt_addr_t addr; - - count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc", - COMPAT_ALTERA_SOCFPGA_DWC2USB, - node, 2); - if (count <= 0) /* No controller found. */ - return 0; - - addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg"); - if (addr == FDT_ADDR_T_NONE) { - printf("UDC Controller has no 'reg' property!\n"); - return -EINVAL; - } - - /* Patch the address from OF into the controller pdata. */ - socfpga_otg_data.regs_otg = addr; - - return dwc2_udc_probe(&socfpga_otg_data); -} - -int g_dnl_board_usb_cable_connected(void) -{ - return 1; -} -#endif diff --git a/board/ebv/socrates/socfpga.c b/board/ebv/socrates/socfpga.c index 449f3b5..97fb902 100644 --- a/board/ebv/socrates/socfpga.c +++ b/board/ebv/socrates/socfpga.c @@ -3,60 +3,4 @@ * * SPDX-License-Identifier: GPL-2.0+ */ - #include <common.h> -#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h> - -#include <usb.h> -#include <usb/dwc2_udc.h> - -DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} - -#ifdef CONFIG_USB_GADGET -struct dwc2_plat_otg_data socfpga_otg_data = { - .usb_gusbcfg = 0x1417, -}; - -int board_usb_init(int index, enum usb_init_type init) -{ - int node[2], count; - fdt_addr_t addr; - - count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc", - COMPAT_ALTERA_SOCFPGA_DWC2USB, - node, 2); - if (count <= 0) /* No controller found. */ - return 0; - - addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg"); - if (addr == FDT_ADDR_T_NONE) { - printf("UDC Controller has no 'reg' property!\n"); - return -EINVAL; - } - - /* Patch the address from OF into the controller pdata. */ - socfpga_otg_data.regs_otg = addr; - - return dwc2_udc_probe(&socfpga_otg_data); -} - -int g_dnl_board_usb_cable_connected(void) -{ - return 1; -} -#endif diff --git a/board/sr1500/socfpga.c b/board/sr1500/socfpga.c index 9f89584..617dffa 100644 --- a/board/sr1500/socfpga.c +++ b/board/sr1500/socfpga.c @@ -5,27 +5,10 @@ */
#include <common.h> -#include <i2c.h> -#include <miiphy.h> #include <asm/arch/reset_manager.h> #include <asm/gpio.h> #include <asm/io.h>
-DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} - int board_early_init_f(void) { int ret; diff --git a/board/terasic/de0-nano-soc/socfpga.c b/board/terasic/de0-nano-soc/socfpga.c index 3ccc2a7..97fb902 100644 --- a/board/terasic/de0-nano-soc/socfpga.c +++ b/board/terasic/de0-nano-soc/socfpga.c @@ -3,20 +3,4 @@ * * SPDX-License-Identifier: GPL-2.0+ */ - #include <common.h> - -DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} diff --git a/board/terasic/sockit/socfpga.c b/board/terasic/sockit/socfpga.c index 1fe8c1c..97fb902 100644 --- a/board/terasic/sockit/socfpga.c +++ b/board/terasic/sockit/socfpga.c @@ -3,60 +3,4 @@ * * SPDX-License-Identifier: GPL-2.0+ */ - #include <common.h> -#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h> - -#include <usb.h> -#include <usb/dwc2_udc.h> - -DECLARE_GLOBAL_DATA_PTR; - -void s_init(void) {} - -/* - * Miscellaneous platform dependent initialisations - */ -int board_init(void) -{ - /* Address of boot parameters for ATAG (if ATAG is used) */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - - return 0; -} - -#ifdef CONFIG_USB_GADGET -struct dwc2_plat_otg_data socfpga_otg_data = { - .usb_gusbcfg = 0x1417, -}; - -int board_usb_init(int index, enum usb_init_type init) -{ - int node[2], count; - fdt_addr_t addr; - - count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc", - COMPAT_ALTERA_SOCFPGA_DWC2USB, - node, 2); - if (count <= 0) /* No controller found. */ - return -EINVAL; - - addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg"); - if (addr == FDT_ADDR_T_NONE) { - printf("UDC Controller has no 'reg' property!\n"); - return -EINVAL; - } - - /* Patch the address from OF into the controller pdata. */ - socfpga_otg_data.regs_otg = addr; - - return dwc2_udc_probe(&socfpga_otg_data); -} - -int g_dnl_board_usb_cable_connected(void) -{ - return 1; -} -#endif

On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
Drop all the common board code, since it is not completely useless.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
board/altera/arria5-socdk/socfpga.c | 56 -------------------------
board/altera/cyclone5-socdk/socfpga.c | 56 -------------------------
board/denx/mcvevk/socfpga.c | 56 -------------------------
board/ebv/socrates/socfpga.c | 56 -------------------------
board/sr1500/socfpga.c | 17 ----------- board/terasic/de0-nano-soc/socfpga.c | 16 ---------- board/terasic/sockit/socfpga.c | 56 -------------------------
7 files changed, 313 deletions(-)
diff --git a/board/altera/arria5-socdk/socfpga.c b/board/altera/arria5-socdk/socfpga.c index 449f3b5..97fb902 100644 --- a/board/altera/arria5-socdk/socfpga.c +++ b/board/altera/arria5-socdk/socfpga.c @@ -3,60 +3,4 @@
- SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h> -#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h>
-#include <usb.h> -#include <usb/dwc2_udc.h>
-DECLARE_GLOBAL_DATA_PTR;
-void s_init(void) {}
-/*
- Miscellaneous platform dependent initialisations
- */
-int board_init(void) -{
- /* Address of boot parameters for ATAG (if ATAG is used) */
- gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
- return 0;
-}
Suggesting to keep the board_init function where user can put board specific initialization here.
Thanks Chin Liang

On Monday, December 07, 2015 at 01:56:23 PM, Chin Liang See wrote:
On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
Drop all the common board code, since it is not completely useless.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
board/altera/arria5-socdk/socfpga.c | 56 -------------------------
board/altera/cyclone5-socdk/socfpga.c | 56 -------------------------
board/denx/mcvevk/socfpga.c | 56 -------------------------
board/ebv/socrates/socfpga.c | 56 -------------------------
board/sr1500/socfpga.c | 17 ----------- board/terasic/de0-nano-soc/socfpga.c | 16 ---------- board/terasic/sockit/socfpga.c | 56 -------------------------
7 files changed, 313 deletions(-)
diff --git a/board/altera/arria5-socdk/socfpga.c b/board/altera/arria5-socdk/socfpga.c index 449f3b5..97fb902 100644 --- a/board/altera/arria5-socdk/socfpga.c +++ b/board/altera/arria5-socdk/socfpga.c @@ -3,60 +3,4 @@
- SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
-#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h>
-#include <usb.h> -#include <usb/dwc2_udc.h>
-DECLARE_GLOBAL_DATA_PTR;
-void s_init(void) {}
-/*
- Miscellaneous platform dependent initialisations
- */
-int board_init(void) -{
- /* Address of boot parameters for ATAG (if ATAG is used) */
- gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
- return 0;
-}
Suggesting to keep the board_init function where user can put board specific initialization here.
If the need for that ever arises, you can make the board_init in board.c __weak and override it here. But there should be no need for any board specific init, the DT should be the only place where such things should be described.

On Mon, 2015-12-07 at 14:22 +0100, Marek Vasut wrote:
On Monday, December 07, 2015 at 01:56:23 PM, Chin Liang See wrote:
On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
Drop all the common board code, since it is not completely useless.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
board/altera/arria5-socdk/socfpga.c | 56 ---------------------
board/altera/cyclone5-socdk/socfpga.c | 56 ---------------------
board/denx/mcvevk/socfpga.c | 56 ---------------------
board/ebv/socrates/socfpga.c | 56 ---------------------
board/sr1500/socfpga.c | 17 ----------- board/terasic/de0-nano-soc/socfpga.c | 16 ---------- board/terasic/sockit/socfpga.c | 56 ---------------------
7 files changed, 313 deletions(-)
diff --git a/board/altera/arria5-socdk/socfpga.c b/board/altera/arria5-socdk/socfpga.c index 449f3b5..97fb902 100644 --- a/board/altera/arria5-socdk/socfpga.c +++ b/board/altera/arria5-socdk/socfpga.c @@ -3,60 +3,4 @@
- SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
-#include <errno.h> -#include <asm/arch/reset_manager.h> -#include <asm/io.h>
-#include <usb.h> -#include <usb/dwc2_udc.h>
-DECLARE_GLOBAL_DATA_PTR;
-void s_init(void) {}
-/*
- Miscellaneous platform dependent initialisations
- */
-int board_init(void) -{
- /* Address of boot parameters for ATAG (if ATAG is used)
*/
- gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
- return 0;
-}
Suggesting to keep the board_init function where user can put board specific initialization here.
If the need for that ever arises, you can make the board_init in board.c __weak and override it here. But there should be no need for any board specific init, the DT should be the only place where such things should be described.
Sound good to me as I dun have strong opinion on this. Will see anyone would need that too :)
Acked-by: Chin Liang See clsee@altera.com
Thanks Chin Liang

On Sat, 2015-12-05 at 21:44 +0100, Marek Vasut wrote:
There is no VT for this board, so remove this incorrect macro.
Signed-off-by: Marek Vasut marex@denx.de Cc: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com
include/configs/socfpga_de0_nano_soc.h | 4 ---- 1 file changed, 4 deletions(-)
Reviewed-by: Chin Liang See clsee@altera.com
Thanks Chin Liang
participants (2)
-
Chin Liang See
-
Marek Vasut