Skip to contentSkip to conversation

at91: taurus: Fix the build warnings

PATCH Superseded Heiko Schocher 2 participants 5 messages Apr 16, 2019 – Apr 27, 2019

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover at91: taurus: Fix the build warnings

Fix build Warnings:
===================== WARNING ====================== This board does not use CONFIG_DM_USB. Please update the board to use CONFIG_DM_USB before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info.
====================================================
CONFIG_OF_EMBED is enabled. This option should only be used for debugging purposes. Please use CONFIG_OF_SEPARATE for boards in mainline.
See doc/README.fdt-control for more info.
This board does not use CONFIG_DM_SPI_FLASH. Please update the board to use CONFIG_SPI_FLASH before the v2019.07 release.

travis build:
https://travis-ci.org/hsdenx/u-boot/builds/520626543

Changes in v2:
- add comment from Eugen
fix axm_defconfig
- sync defconfig
make savedefconfig with newest mainline
- set EXTRA_ENV_SETTINGS for axm board
- set BOARD_AXM or BOARD_TAURUS through Kconfig and remove entry in scripts/config_whitelist.txt
- removed patch "at91sam9260.dtsi: add some labels" as already applied from Eugen
- rebased series against u-boot-at91
- new in v2 as Eugen Hristev used -Werror and build failed.

Heiko Schocher (2):
at91: cleanup taurus port
dtb_platdata.py: prevent define generation of alias

 arch/arm/dts/at91sam9g20-taurus.dts | 158 ++++++++++++++--------------
 board/siemens/taurus/Kconfig        |  16 +++
 board/siemens/taurus/taurus.c       |  33 +-----
 configs/axm_defconfig               |  46 ++++++--
 configs/taurus_defconfig            |  40 +++++--
 include/configs/taurus.h            |  57 +++++++++-
 scripts/config_whitelist.txt        |   2 -
 tools/dtoc/dtb_platdata.py          |   5 +-
 8 files changed, 222 insertions(+), 135 deletions(-)
Signature · 1 line
2.17.2
#1 lore raw

PATCH v2 1/2 at91: cleanup taurus port

- at91sam9g20-taurus.dts: use labels
- cleanup taurus port to compile clean with
current mainline again. SPL has no serial
output anymore, so it fits into SRAM.

---

Changes in v2:
- add comment from Eugen
fix axm_defconfig
- sync defconfig
make savedefconfig with newest mainline
- set EXTRA_ENV_SETTINGS for axm board
- set BOARD_AXM or BOARD_TAURUS through Kconfig and remove entry in scripts/config_whitelist.txt
- removed patch "at91sam9260.dtsi: add some labels" as already applied from Eugen
- rebased series against u-boot-at91

 arch/arm/dts/at91sam9g20-taurus.dts | 158 ++++++++++++++--------------
 board/siemens/taurus/Kconfig        |  16 +++
 board/siemens/taurus/taurus.c       |  33 +-----
 configs/axm_defconfig               |  46 ++++++--
 configs/taurus_defconfig            |  40 +++++--
 include/configs/taurus.h            |  57 +++++++++-
 scripts/config_whitelist.txt        |   2 -
 7 files changed, 219 insertions(+), 133 deletions(-)
arch/arm/dts/at91sam9g20-taurus.dts +78 -80
index cee228bb8c..c00c5a8b8d 100644
@@ -15,7 +15,7 @@
 
 / {
 	model = "Siemens taurus";
-	compatible = "atmel,at91sam9g20ek", "atmel,at91sam9g20", "atmel,at91sam9";
+	compatible = "atmel,at91sam9g20", "atmel,at91sam9";
 
 	chosen {
 		u-boot,dm-pre-reloc;
@@ -35,88 +35,86 @@
 			clock-frequency = <18432000>;
 		};
 	};
+};
 
-	ahb {
-		apb {
-			pinctrl at fffff400 {
-				board {
-					pinctrl_pck0_as_mck: pck0_as_mck {
-						atmel,pins =
-							<AT91_PIOC 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PC1 periph B */
-					};
-
-				};
-			};
-
-			dbgu: serial at fffff200 {
-				u-boot,dm-pre-reloc;
-				status = "okay";
-			};
-
-			usart0: serial at fffb0000 {
-				pinctrl-0 =
-					<&pinctrl_usart0
-					 &pinctrl_usart0_rts
-					 &pinctrl_usart0_cts
-					 &pinctrl_usart0_dtr_dsr
-					 &pinctrl_usart0_dcd
-					 &pinctrl_usart0_ri>;
-				status = "okay";
-			};
-
-			usart1: serial at fffb4000 {
-				status = "okay";
-			};
-
-			macb0: ethernet at fffc4000 {
-				phy-mode = "rmii";
-				status = "okay";
-			};
-
-			usb1: gadget at fffa4000 {
-				atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
-				status = "okay";
-			};
-
-			ssc0: ssc at fffbc000 {
-				status = "okay";
-				pinctrl-0 = <&pinctrl_ssc0_tx>;
-			};
-
-			spi0: spi at fffc8000 {
-				cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
-				mtd_dataflash at 0 {
-					compatible = "atmel,at45", "atmel,dataflash";
-					spi-max-frequency = <50000000>;
-					reg = <1>;
-				};
-			};
-
-			rtc at fffffd20 {
-				atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
-				status = "okay";
-			};
-
-			watchdog at fffffd40 {
-				timeout-sec = <15>;
-				status = "okay";
-			};
-
-			gpbr: syscon at fffffd50 {
-				status = "okay";
-			};
-		};
+&dbgu {
+	status = "okay";
+};
 
-		nand0: nand at 40000000 {
-			nand-bus-width = <8>;
-			nand-ecc-mode = "soft";
-			nand-on-flash-bbt;
-			status = "okay";
-		};
+&gpbr {
+	status = "okay";
+};
+
+&macb0 {
+	phy-mode = "rmii";
+	status = "okay";
+};
 
-		usb0: ohci at 00500000 {
-			num-ports = <2>;
-			status = "okay";
+&nand0 {
+	nand-bus-width = <8>;
+	nand-ecc-mode = "soft";
+	nand-on-flash-bbt;
+	status = "okay";
+};
+
+&pinctrl {
+	u-boot,dm-pre-reloc;
+	board {
+		pinctrl_pck0_as_mck: pck0_as_mck {
+			atmel,pins =
+			/* PC1 periph B */
+			<AT91_PIOC 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;
 		};
+
 	};
 };
+
+&rtc {
+	atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
+	status = "okay";
+};
+
+&spi0 {
+	cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
+	mtd_dataflash at 0 {
+		compatible = "atmel,at45", "atmel,dataflash";
+		spi-max-frequency = <50000000>;
+		reg = <1>;
+	};
+};
+
+&ssc0 {
+	status = "okay";
+	pinctrl-0 = <&pinctrl_ssc0_tx>;
+};
+
+&usart0 {
+	pinctrl-0 =
+		<&pinctrl_usart0
+		 &pinctrl_usart0_rts
+		 &pinctrl_usart0_cts
+		 &pinctrl_usart0_dtr_dsr
+		 &pinctrl_usart0_dcd
+		 &pinctrl_usart0_ri>;
+	status = "okay";
+};
+
+&usart1 {
+	status = "okay";
+};
+
+&usb0 {
+	num-ports = <2>;
+	status = "okay";
+};
+
+&usb1 {
+	atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+};
+
+&watchdog {
+	u-boot,dm-pre-reloc;
+	timeout-sec = <15>;
+	status = "okay";
+};
board/siemens/taurus/Kconfig +16 -0
index cf71e4ce56..28816bc1a0 100644
@@ -9,4 +9,20 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
 	default "taurus"
 
+choice
+	prompt "Board Type AXM/TAURUS"
+	default BOARD_AXM
+
+config BOARD_AXM
+	bool "AXM board type"
+	help
+	  Select this, if you want to build for AXM board.
+
+config BOARD_TAURUS
+	bool "TAURUS board type"
+	help
+	  Select this, if you want to build for TAURUS board.
+
+endchoice
+
 endif
board/siemens/taurus/taurus.c +2 -31
index 8396ce502b..6ea97eb4e8 100644
@@ -197,11 +197,11 @@ void mem_init(void)
 
 	/* Mirrors at A15 on ATMEL G20 SDRAM Controller with 64MB*/
 	if (ram_size == 0x800) {
-		printf("\n\r 64MB");
+		printf("\n\r 64MB\n");
 		sdramc_configure(AT91_SDRAMC_NC_9);
 	} else {
 		/* Size already initialized */
-		printf("\n\r 128MB");
+		printf("\n\r 128MB\n");
 	}
 }
 #endif
@@ -282,24 +282,6 @@ int board_early_init_f(void)
 	return 0;
 }
 
-/* FIXME gpio code here need to handle through DM_GPIO */
-#ifndef CONFIG_DM_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-	return bus == 0 && cs == 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-	at91_set_gpio_value(TAURUS_SPI_CS_PIN, 0);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-	at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1);
-}
-#endif
-
 #ifdef CONFIG_USB_GADGET_AT91
 #include <linux/usb/at91_udc.h>
 
@@ -347,17 +329,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifndef CONFIG_DM_ETH
-int board_eth_init(bd_t *bis)
-{
-	int rc = 0;
-#ifdef CONFIG_MACB
-	rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC0, 0x00);
-#endif
-	return rc;
-}
-#endif
-
 #if !defined(CONFIG_SPL_BUILD)
 #if defined(CONFIG_BOARD_AXM)
 /*
configs/axm_defconfig +36 -8

82 lines not on this page · raw message

CONFIG_USE_TINY_PRINTF=y
+CONFIG_HEXDUMP=y
+# CONFIG_EFI_LOADER is not set

configs/taurus_defconfig +33 -7
index d69f4895ef..e97f121d8e 100644
@@ -1,28 +1,39 @@
 CONFIG_ARM=y
-CONFIG_SPL_SYS_THUMB_BUILD=y
+CONFIG_SYS_THUMB_BUILD=y
 # CONFIG_SPL_USE_ARCH_MEMCPY is not set
 # CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SPL_LDSCRIPT="arch/$(ARCH)/cpu/u-boot-spl.lds"
 CONFIG_SYS_TEXT_BASE=0x21000000
 CONFIG_TARGET_TAURUS=y
+CONFIG_BOARD_TAURUS=y
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SYS_MALLOC_F_LEN=0x1000
-CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
 CONFIG_SPL=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEBUG_UART_BASE=0xfffff200
+CONFIG_DEBUG_UART_CLOCK=18432000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
-CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS"
+CONFIG_DEBUG_UART=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x1000
+CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2067"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="nand read 0x22000000 0x200000 0x300000; bootm"
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_BOARD_EARLY_INIT_F=y
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+# CONFIG_TPL_BANNER_PRINT is not set
+CONFIG_SPL_CRC32_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
@@ -31,6 +42,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -41,25 +53,39 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_MTDPARTS=y
 # CONFIG_DOS_PARTITION is not set
 CONFIG_OF_CONTROL=y
-CONFIG_OF_EMBED=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20-taurus"
+CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_SPL_DM=y
+CONFIG_BLK=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
 CONFIG_NAND_ATMEL=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_SPECIFY_CONSOLE_INDEX=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_ATMEL_USART=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0908
 CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_WATCHDOG=y
 CONFIG_WDT=y
 CONFIG_WDT_AT91=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_HEXDUMP=y
+# CONFIG_EFI_LOADER is not set
include/configs/taurus.h +52 -5

91 lines not on this page · raw message

scripts/config_whitelist.txt +0 -2
index fa98efc24c..dfdc5f0be6 100644
@@ -118,7 +118,6 @@ CONFIG_BMP_32BPP
 CONFIG_BOARDDIR
 CONFIG_BOARDNAME
 CONFIG_BOARDNAME_LOCAL
-CONFIG_BOARD_AXM
 CONFIG_BOARD_COMMON
 CONFIG_BOARD_ECC_SUPPORT
 CONFIG_BOARD_IS_OPENRD_BASE
@@ -128,7 +127,6 @@ CONFIG_BOARD_NAME
 CONFIG_BOARD_POSTCLK_INIT
 CONFIG_BOARD_REVISION_TAG
 CONFIG_BOARD_SIZE_LIMIT
-CONFIG_BOARD_TAURUS
 CONFIG_BOOGER
 CONFIG_BOOTBLOCK
 CONFIG_BOOTFILE
Signature · 1 line
2.17.2
#2 lore raw

PATCH v2 1/2 at91: cleanup taurus port

Quoted 6 lines · Heiko Schocher

- at91sam9g20-taurus.dts: use labels
- cleanup taurus port to compile clean with
current mainline again. SPL has no serial
output anymore, so it fits into SRAM.

This needs to be reworked now to fix some link errors, sorry!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190427/7ba5f11c/attachment.sig>
#3 lore raw

PATCH v2 2/2 dtb_platdata.py: prevent define generation of alias

In reply to Heiko Schocher

generate define for an alias only if the struct is not created already.

This prevents compilerwarning:
PLAT spl/dts/dt-platdata.o
spl/dts/dt-platdata.c:11:46: error: missing braces around initializer [-Werror=missing-braces]

 static const struct dtd_simple_bus dtv_ahb = {
                                              ^
spl/dts/dt-platdata.c:20:46: error: missing braces around initializer [-Werror=missing-braces]
 static const struct dtd_simple_bus dtv_apb = {
                                              ^

cc1: all warnings being treated as errors

on the at91 based taurus board. Reason is in at91sam9260.dtsi is defined:

ahb {
        compatible = "simple-bus";
        ranges;

and later:

pinctrl: pinctrl at fffff400 {
        compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
        ranges = <0xfffff400 0xfffff400 0x600>;

without this patch dtoc generates:

struct dtd_atmel_at91rm9200_pinctrl {
	fdt32_t		atmel_mux_mask[6];
	fdt32_t		ranges[3];
	fdt32_t		reg[6];
};
struct dtd_simple_bus {
        bool            ranges;
};

"#define dtd_simple_bus dtd_atmel_at91rm9200_pinctrl"

and the line with "define dtd_simple_bus..." introduces the warning. This define is not needed.

---
added Simon Glass to cc, as I am unsure if this is a correct fix. Travis build is fine, so I think, it breaks no boards.

Changes in v2:
- new in v2 as Eugen Hristev used -Werror and
build failed.

 tools/dtoc/dtb_platdata.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/dtoc/dtb_platdata.py +3 -2
index ca580b45d4..17a3dccb11 100644
@@ -450,8 +450,9 @@ class DtbPlatdata(object):
             self.out('};\n')
 
         for alias, struct_name in self._aliases.iteritems():
-            self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
-                                             STRUCT_PREFIX, struct_name))
+            if alias not in sorted(structs):
+                self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias,
+                                                 STRUCT_PREFIX, struct_name))
 
     def output_node(self, node):
         """Output the C code for a node
Signature · 1 line
2.17.2
#4 lore raw

PATCH v2 2/2 dtb_platdata.py: prevent define generation of alias

Quoted 38 lines · Heiko Schocher

generate define for an alias only if the struct is not created already.

This prevents compilerwarning:
PLAT spl/dts/dt-platdata.o
spl/dts/dt-platdata.c:11:46: error: missing braces around initializer [-Werror=missing-braces]

 static const struct dtd_simple_bus dtv_ahb = {
                                              ^
spl/dts/dt-platdata.c:20:46: error: missing braces around initializer [-Werror=missing-braces]
 static const struct dtd_simple_bus dtv_apb = {
                                              ^

cc1: all warnings being treated as errors

on the at91 based taurus board. Reason is in at91sam9260.dtsi is defined:

ahb {
        compatible = "simple-bus";
        ranges;

and later:

pinctrl: pinctrl at fffff400 {
        compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
        ranges = <0xfffff400 0xfffff400 0x600>;

without this patch dtoc generates:

struct dtd_atmel_at91rm9200_pinctrl {
	fdt32_t		atmel_mux_mask[6];
	fdt32_t		ranges[3];
	fdt32_t		reg[6];
};
struct dtd_simple_bus {
        bool            ranges;
};
Quoted 6 lines

"#define dtd_simple_bus dtd_atmel_at91rm9200_pinctrl"

and the line with "define dtd_simple_bus..." introduces the warning. This define is not needed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190427/f6d7bdde/attachment.sig>