[U-Boot] [PATCH 0/2] at91: fix smartweb board support

since commit: f8b7fff1d5c5 "serial: atmel_usart: Add clk support" smartweb board comes not up anymore. Fix it.
While at it, fix compiler warning for drivers/usb/gadget/at91_udc.c
Heiko Schocher (2): drivers, usb, gadget: fix compiler warnings for at91_udc.c atmel, at91: fix smartweb board
arch/arm/dts/at91sam9260-smartweb.dts | 2 ++ board/siemens/smartweb/smartweb.c | 9 --------- configs/smartweb_defconfig | 3 +++ drivers/usb/gadget/at91_udc.c | 30 +++--------------------------- include/configs/smartweb.h | 3 +++ 5 files changed, 11 insertions(+), 36 deletions(-)

fix warnings: drivers/usb/gadget/at91_udc.c:1344:12: warning: 'at91rm9200_udc_init' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1379:13: warning: 'at91rm9200_udc_pullup' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1476:12: warning: 'at91sam9263_udc_init' defined but not used [-Wunused-function]
Signed-off-by: Heiko Schocher hs@denx.de ---
drivers/usb/gadget/at91_udc.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 01a5907..85bfbf5 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1341,7 +1341,7 @@ static int at91_stop(struct usb_gadget *gadget)
/*-------------------------------------------------------------------------*/
-static int at91rm9200_udc_init(struct at91_udc *udc) +static __maybe_unused int at91rm9200_udc_init(struct at91_udc *udc) { struct at91_ep *ep; int ret; @@ -1376,7 +1376,8 @@ static int at91rm9200_udc_init(struct at91_udc *udc) return 0; }
-static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) +static __maybe_unused +void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) { int active = !udc->board.pullup_active_low;
@@ -1473,31 +1474,6 @@ static const struct at91_udc_caps at91sam9261_udc_caps = { }; #endif
-static int at91sam9263_udc_init(struct at91_udc *udc) -{ - struct at91_ep *ep; - int i; - - for (i = 0; i < NUM_ENDPOINTS; i++) { - ep = &udc->ep[i]; - - switch (i) { - case 0: - case 1: - case 2: - case 3: - ep->maxpacket = 64; - break; - case 4: - case 5: - ep->maxpacket = 256; - break; - } - } - - return 0; -} - int usb_gadget_handle_interrupts(int index) { struct at91_udc *udc = controller;

Hi Heiko,
fix warnings: drivers/usb/gadget/at91_udc.c:1344:12: warning: 'at91rm9200_udc_init' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1379:13: warning: 'at91rm9200_udc_pullup' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1476:12: warning: 'at91sam9263_udc_init' defined but not used [-Wunused-function]
Signed-off-by: Heiko Schocher hs@denx.de
drivers/usb/gadget/at91_udc.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 01a5907..85bfbf5 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1341,7 +1341,7 @@ static int at91_stop(struct usb_gadget *gadget)
/*-------------------------------------------------------------------------*/
-static int at91rm9200_udc_init(struct at91_udc *udc) +static __maybe_unused int at91rm9200_udc_init(struct at91_udc *udc) { struct at91_ep *ep; int ret; @@ -1376,7 +1376,8 @@ static int at91rm9200_udc_init(struct at91_udc *udc) return 0; }
-static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) +static __maybe_unused +void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) { int active = !udc->board.pullup_active_low;
@@ -1473,31 +1474,6 @@ static const struct at91_udc_caps at91sam9261_udc_caps = { }; #endif
-static int at91sam9263_udc_init(struct at91_udc *udc)
I'm a bit puzzled...
For the at91rm9200 related boards it is enough to add __maybe_unused and leave the unused function in the source code.
Hence, I'm wondering why do you remove the function for at91sam9263?
Shouldn't all be removed or have added __maybe_unused ?
-{
- struct at91_ep *ep;
- int i;
- for (i = 0; i < NUM_ENDPOINTS; i++) {
ep = &udc->ep[i];
switch (i) {
case 0:
case 1:
case 2:
case 3:
ep->maxpacket = 64;
break;
case 4:
case 5:
ep->maxpacket = 256;
break;
}
- }
- return 0;
-}
int usb_gadget_handle_interrupts(int index) { struct at91_udc *udc = controller;
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

Hello Lukasz,
Am 23.06.2017 um 14:50 schrieb Lukasz Majewski:
Hi Heiko,
fix warnings: drivers/usb/gadget/at91_udc.c:1344:12: warning: 'at91rm9200_udc_init' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1379:13: warning: 'at91rm9200_udc_pullup' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1476:12: warning: 'at91sam9263_udc_init' defined but not used [-Wunused-function]
Signed-off-by: Heiko Schocher hs@denx.de
drivers/usb/gadget/at91_udc.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 01a5907..85bfbf5 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1341,7 +1341,7 @@ static int at91_stop(struct usb_gadget *gadget)
/*-------------------------------------------------------------------------*/
-static int at91rm9200_udc_init(struct at91_udc *udc) +static __maybe_unused int at91rm9200_udc_init(struct at91_udc *udc) { struct at91_ep *ep; int ret; @@ -1376,7 +1376,8 @@ static int at91rm9200_udc_init(struct at91_udc *udc) return 0; }
-static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) +static __maybe_unused +void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) { int active = !udc->board.pullup_active_low;
@@ -1473,31 +1474,6 @@ static const struct at91_udc_caps at91sam9261_udc_caps = { }; #endif
-static int at91sam9263_udc_init(struct at91_udc *udc)
I'm a bit puzzled...
For the at91rm9200 related boards it is enough to add __maybe_unused and leave the unused function in the source code.
Hence, I'm wondering why do you remove the function for at91sam9263?
Shouldn't all be removed or have added __maybe_unused ?
Hmm.. No, it seems there are no users for the at91sam9263_udc_init()
pollux:u-boot hs [master] $ grep -lr at91sam9263_udc_init . ./drivers/usb/gadget/at91_udc.c pollux:u-boot hs [master] $
And in ./drivers/usb/gadget/at91_udc.c it is only defined, but not used...
bye, Heiko
-{
- struct at91_ep *ep;
- int i;
- for (i = 0; i < NUM_ENDPOINTS; i++) {
ep = &udc->ep[i];
switch (i) {
case 0:
case 1:
case 2:
case 3:
ep->maxpacket = 64;
break;
case 4:
case 5:
ep->maxpacket = 256;
break;
}
- }
- return 0;
-}
- int usb_gadget_handle_interrupts(int index) { struct at91_udc *udc = controller;
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

On Fri, Jun 23, 2017 at 03:31:35PM +0200, Heiko Schocher wrote:
Hello Lukasz,
Am 23.06.2017 um 14:50 schrieb Lukasz Majewski:
Hi Heiko,
fix warnings: drivers/usb/gadget/at91_udc.c:1344:12: warning: 'at91rm9200_udc_init' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1379:13: warning: 'at91rm9200_udc_pullup' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1476:12: warning: 'at91sam9263_udc_init' defined but not used [-Wunused-function]
Signed-off-by: Heiko Schocher hs@denx.de
drivers/usb/gadget/at91_udc.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 01a5907..85bfbf5 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1341,7 +1341,7 @@ static int at91_stop(struct usb_gadget *gadget)
/*-------------------------------------------------------------------------*/
-static int at91rm9200_udc_init(struct at91_udc *udc) +static __maybe_unused int at91rm9200_udc_init(struct at91_udc *udc) { struct at91_ep *ep; int ret; @@ -1376,7 +1376,8 @@ static int at91rm9200_udc_init(struct at91_udc *udc) return 0; }
-static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) +static __maybe_unused +void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) { int active = !udc->board.pullup_active_low;
@@ -1473,31 +1474,6 @@ static const struct at91_udc_caps at91sam9261_udc_caps = { }; #endif
-static int at91sam9263_udc_init(struct at91_udc *udc)
I'm a bit puzzled...
For the at91rm9200 related boards it is enough to add __maybe_unused and leave the unused function in the source code.
Hence, I'm wondering why do you remove the function for at91sam9263?
Shouldn't all be removed or have added __maybe_unused ?
Hmm.. No, it seems there are no users for the at91sam9263_udc_init()
pollux:u-boot hs [master] $ grep -lr at91sam9263_udc_init . ./drivers/usb/gadget/at91_udc.c pollux:u-boot hs [master] $
And in ./drivers/usb/gadget/at91_udc.c it is only defined, but not used...
So in sum, a v2 to drop this now unused code then, yes? Thanks!

Hi Heiko,
Hello Lukasz,
Am 23.06.2017 um 14:50 schrieb Lukasz Majewski:
Hi Heiko,
fix warnings: drivers/usb/gadget/at91_udc.c:1344:12: warning: 'at91rm9200_udc_init' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1379:13: warning: 'at91rm9200_udc_pullup' defined but not used [-Wunused-function] drivers/usb/gadget/at91_udc.c:1476:12: warning: 'at91sam9263_udc_init' defined but not used [-Wunused-function]
Signed-off-by: Heiko Schocher hs@denx.de
drivers/usb/gadget/at91_udc.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 01a5907..85bfbf5 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1341,7 +1341,7 @@ static int at91_stop(struct usb_gadget *gadget)
/*-------------------------------------------------------------------------*/
-static int at91rm9200_udc_init(struct at91_udc *udc) +static __maybe_unused int at91rm9200_udc_init(struct at91_udc *udc) { struct at91_ep *ep; int ret; @@ -1376,7 +1376,8 @@ static int at91rm9200_udc_init(struct at91_udc *udc) return 0; }
-static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) +static __maybe_unused +void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on) { int active = !udc->board.pullup_active_low;
@@ -1473,31 +1474,6 @@ static const struct at91_udc_caps at91sam9261_udc_caps = { }; #endif
-static int at91sam9263_udc_init(struct at91_udc *udc)
I'm a bit puzzled...
For the at91rm9200 related boards it is enough to add __maybe_unused and leave the unused function in the source code.
Hence, I'm wondering why do you remove the function for at91sam9263?
Shouldn't all be removed or have added __maybe_unused ?
Hmm.. No, it seems there are no users for the at91sam9263_udc_init()
pollux:u-boot hs [master] $ grep -lr at91sam9263_udc_init . ./drivers/usb/gadget/at91_udc.c pollux:u-boot hs [master] $
And in ./drivers/usb/gadget/at91_udc.c it is only defined, but not used...
Aaaa...... Ok I see.
Review-by: Lukasz Majewski lukma@denx.de
bye, Heiko
-{
- struct at91_ep *ep;
- int i;
- for (i = 0; i < NUM_ENDPOINTS; i++) {
ep = &udc->ep[i];
switch (i) {
case 0:
case 1:
case 2:
case 3:
ep->maxpacket = 64;
break;
case 4:
case 5:
ep->maxpacket = 256;
break;
}
- }
- return 0;
-}
- int usb_gadget_handle_interrupts(int index) { struct at91_udc *udc = controller;
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

since commit: f8b7fff1d5c5 "serial: atmel_usart: Add clk support"
smartweb board comes not up anymore. Fix it.
Signed-off-by: Heiko Schocher hs@denx.de ---
arch/arm/dts/at91sam9260-smartweb.dts | 2 ++ board/siemens/smartweb/smartweb.c | 9 --------- configs/smartweb_defconfig | 3 +++ include/configs/smartweb.h | 3 +++ 4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/arm/dts/at91sam9260-smartweb.dts b/arch/arm/dts/at91sam9260-smartweb.dts index faed763..e59781b 100644 --- a/arch/arm/dts/at91sam9260-smartweb.dts +++ b/arch/arm/dts/at91sam9260-smartweb.dts @@ -18,6 +18,7 @@ compatible = "atmel,at91sam9260", "atmel,at91sam9";
chosen { + u-boot,dm-pre-reloc; stdout-path = &dbgu; };
@@ -48,6 +49,7 @@ };
dbgu: serial@fffff200 { + u-boot,dm-pre-reloc; status = "okay"; };
diff --git a/board/siemens/smartweb/smartweb.c b/board/siemens/smartweb/smartweb.c index 78a7946..718ccc7 100644 --- a/board/siemens/smartweb/smartweb.c +++ b/board/siemens/smartweb/smartweb.c @@ -256,12 +256,3 @@ void mem_init(void) sdramc_initialize(ATMEL_BASE_CS1, &setting); } #endif - -static struct atmel_serial_platdata at91sam9260_serial_plat = { - .base_addr = ATMEL_BASE_DBGU, -}; - -U_BOOT_DEVICE(at91sam9260_serial) = { - .name = "serial_atmel", - .platdata = &at91sam9260_serial_plat, -}; diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig index 48c8781..a769fc5 100644 --- a/configs/smartweb_defconfig +++ b/configs/smartweb_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SMARTWEB=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_SPL_NAND_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="at91sam9260-smartweb" CONFIG_FIT=y @@ -33,6 +34,8 @@ CONFIG_CMD_FAT=y # CONFIG_DOS_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y +CONFIG_CLK=y +CONFIG_CLK_AT91=y CONFIG_DFU_NAND=y # CONFIG_MMC is not set CONFIG_USB=y diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h index 1236da7..8400278 100644 --- a/include/configs/smartweb.h +++ b/include/configs/smartweb.h @@ -211,6 +211,9 @@ #define CONFIG_SYS_INIT_SP_ADDR 0x301000 #define CONFIG_SPL_STACK_R #define CONFIG_SPL_STACK_R_ADDR CONFIG_SYS_TEXT_BASE +/* we have only 4k sram in SPL, so cut SYS_MALLOC_F_LEN */ +#undef CONFIG_SYS_MALLOC_F_LEN +#define CONFIG_SYS_MALLOC_F_LEN 0x400 #else /* * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,

On 22 June 2017 at 00:49, Heiko Schocher hs@denx.de wrote:
since commit: f8b7fff1d5c5 "serial: atmel_usart: Add clk support"
smartweb board comes not up anymore. Fix it.
Signed-off-by: Heiko Schocher hs@denx.de
arch/arm/dts/at91sam9260-smartweb.dts | 2 ++ board/siemens/smartweb/smartweb.c | 9 --------- configs/smartweb_defconfig | 3 +++ include/configs/smartweb.h | 3 +++ 4 files changed, 8 insertions(+), 9 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
participants (4)
-
Heiko Schocher
-
Lukasz Majewski
-
Simon Glass
-
Tom Rini