All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base
@ 2017-08-20 13:46 Baruch Siach
  2017-08-20 13:46 ` [U-Boot] [PATCH 2/2] arm: mvebu: clearfog: document boot from UART Baruch Siach
  2017-09-18 16:00 ` [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Stefan Roese
  0 siblings, 2 replies; 6+ messages in thread
From: Baruch Siach @ 2017-08-20 13:46 UTC (permalink / raw)
  To: u-boot

The ClearFog Base boot from UART when setting the DIP switches to 01001.
Unfortunately, the SPL code sometimes fails to detect the UART boot
method at run-time. Add an alternative SAR UART boot value to fix this.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 arch/arm/mach-mvebu/include/mach/soc.h | 1 +
 arch/arm/mach-mvebu/spl.c              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
index 0900e4008c12..44bac63b4447 100644
--- a/arch/arm/mach-mvebu/include/mach/soc.h
+++ b/arch/arm/mach-mvebu/include/mach/soc.h
@@ -139,6 +139,7 @@
 #define BOOT_DEV_SEL_MASK	(0x3f << BOOT_DEV_SEL_OFFS)
 
 #define BOOT_FROM_UART		0x28
+#define BOOT_FROM_UART_ALT	0x3f
 #define BOOT_FROM_SPI		0x32
 #define BOOT_FROM_MMC		0x30
 #define BOOT_FROM_MMC_ALT	0x31
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index 3cf02a54cea2..4b9c41360589 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -42,6 +42,7 @@ static u32 get_boot_device(void)
 		return BOOT_DEVICE_MMC1;
 #endif
 	case BOOT_FROM_UART:
+	case BOOT_FROM_UART_ALT:
 		return BOOT_DEVICE_UART;
 	case BOOT_FROM_SPI:
 	default:
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/2] arm: mvebu: clearfog: document boot from UART
  2017-08-20 13:46 [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Baruch Siach
@ 2017-08-20 13:46 ` Baruch Siach
  2017-09-18 16:00 ` [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Stefan Roese
  1 sibling, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2017-08-20 13:46 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 board/solidrun/clearfog/README | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
index 2cfa5bfc8637..ef1e3bf42666 100644
--- a/board/solidrun/clearfog/README
+++ b/board/solidrun/clearfog/README
@@ -16,3 +16,23 @@ $ sudo dd if=u-boot-spl.kwb of=/dev/sdX bs=512 seek=1
 
 Please use the correct device node for your setup instead
 of "/dev/sdX" here!
+
+Boot from UART:
+---------------
+
+Connect the on-board micro-USB (CF Pro: CON11, CF Base: CON5)
+to your host.
+
+Set the SW1 DIP switches to UART boot (0: OFF, 1: ON):
+
+  ClearFog Base: 01001
+  ClearFog Pro:  11110
+
+Run the following command to initiate U-Boot download:
+
+  ./tools/kwboot -b u-boot-spl.kwb /dev/ttyUSBX
+
+Use the correct UART device node for /dev/ttyUSBX.
+
+When download finishes start your favorite terminal emulator
+on /dev/ttyUSBX.
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base
  2017-08-20 13:46 [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Baruch Siach
  2017-08-20 13:46 ` [U-Boot] [PATCH 2/2] arm: mvebu: clearfog: document boot from UART Baruch Siach
@ 2017-09-18 16:00 ` Stefan Roese
  2017-09-18 17:57   ` Baruch Siach
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Roese @ 2017-09-18 16:00 UTC (permalink / raw)
  To: u-boot

Hi Baruch,

On 20.08.2017 15:46, Baruch Siach wrote:
> The ClearFog Base boot from UART when setting the DIP switches to 01001.
> Unfortunately, the SPL code sometimes fails to detect the UART boot
> method at run-time. Add an alternative SAR UART boot value to fix this.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>   arch/arm/mach-mvebu/include/mach/soc.h | 1 +
>   arch/arm/mach-mvebu/spl.c              | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
> index 0900e4008c12..44bac63b4447 100644
> --- a/arch/arm/mach-mvebu/include/mach/soc.h
> +++ b/arch/arm/mach-mvebu/include/mach/soc.h
> @@ -139,6 +139,7 @@
>   #define BOOT_DEV_SEL_MASK	(0x3f << BOOT_DEV_SEL_OFFS)
>   
>   #define BOOT_FROM_UART		0x28
> +#define BOOT_FROM_UART_ALT	0x3f
>   #define BOOT_FROM_SPI		0x32
>   #define BOOT_FROM_MMC		0x30
>   #define BOOT_FROM_MMC_ALT	0x31
> diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
> index 3cf02a54cea2..4b9c41360589 100644
> --- a/arch/arm/mach-mvebu/spl.c
> +++ b/arch/arm/mach-mvebu/spl.c
> @@ -42,6 +42,7 @@ static u32 get_boot_device(void)
>   		return BOOT_DEVICE_MMC1;
>   #endif
>   	case BOOT_FROM_UART:
> +	case BOOT_FROM_UART_ALT:
>   		return BOOT_DEVICE_UART;
>   	case BOOT_FROM_SPI:
>   	default:
> 

This patch produces this error for some MVEBU boards:

[stefan at stefan-work u-boot-marvell (master)]$ make db-mv784mp-gp_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
[stefan at stefan-work u-boot-marvell (master)]$ make -s -j10
arch/arm/mach-mvebu/spl.c: In function ‘get_boot_device’:
arch/arm/mach-mvebu/spl.c:45:7: error: ‘BOOT_FROM_UART_ALT’ undeclared (first use in this function)
  case BOOT_FROM_UART_ALT:
       ^~~~~~~~~~~~~~~~~~
arch/arm/mach-mvebu/spl.c:45:7: note: each undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:280: recipe for target 'spl/arch/arm/mach-mvebu/spl.o' failed


Could you please fix this by either adding this UART_ALT for other
MVEBUs as well (AXP, I didn't check if its available), or restricting
its usage on the A38x?

Please make sure that future patches are compile clean for at least
all MVEBU targets.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base
  2017-09-18 16:00 ` [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Stefan Roese
@ 2017-09-18 17:57   ` Baruch Siach
  2017-09-19  4:48     ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2017-09-18 17:57 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Mon, Sep 18, 2017 at 06:00:23PM +0200, Stefan Roese wrote:
> On 20.08.2017 15:46, Baruch Siach wrote:
> > The ClearFog Base boot from UART when setting the DIP switches to 01001.
> > Unfortunately, the SPL code sometimes fails to detect the UART boot
> > method at run-time. Add an alternative SAR UART boot value to fix this.
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >   arch/arm/mach-mvebu/include/mach/soc.h | 1 +
> >   arch/arm/mach-mvebu/spl.c              | 1 +
> >   2 files changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
> > index 0900e4008c12..44bac63b4447 100644
> > --- a/arch/arm/mach-mvebu/include/mach/soc.h
> > +++ b/arch/arm/mach-mvebu/include/mach/soc.h
> > @@ -139,6 +139,7 @@
> >   #define BOOT_DEV_SEL_MASK	(0x3f << BOOT_DEV_SEL_OFFS)
> >   
> >   #define BOOT_FROM_UART		0x28
> > +#define BOOT_FROM_UART_ALT	0x3f
> >   #define BOOT_FROM_SPI		0x32
> >   #define BOOT_FROM_MMC		0x30
> >   #define BOOT_FROM_MMC_ALT	0x31
> > diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
> > index 3cf02a54cea2..4b9c41360589 100644
> > --- a/arch/arm/mach-mvebu/spl.c
> > +++ b/arch/arm/mach-mvebu/spl.c
> > @@ -42,6 +42,7 @@ static u32 get_boot_device(void)
> >   		return BOOT_DEVICE_MMC1;
> >   #endif
> >   	case BOOT_FROM_UART:
> > +	case BOOT_FROM_UART_ALT:
> >   		return BOOT_DEVICE_UART;
> >   	case BOOT_FROM_SPI:
> >   	default:
> 
> This patch produces this error for some MVEBU boards:
> 
> [stefan at stefan-work u-boot-marvell (master)]$ make db-mv784mp-gp_defconfig
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/kconfig/conf.o
>   SHIPPED scripts/kconfig/zconf.tab.c
>   SHIPPED scripts/kconfig/zconf.lex.c
>   SHIPPED scripts/kconfig/zconf.hash.c
>   HOSTCC  scripts/kconfig/zconf.tab.o
>   HOSTLD  scripts/kconfig/conf
> #
> # configuration written to .config
> #
> [stefan at stefan-work u-boot-marvell (master)]$ make -s -j10
> arch/arm/mach-mvebu/spl.c: In function ‘get_boot_device’:
> arch/arm/mach-mvebu/spl.c:45:7: error: ‘BOOT_FROM_UART_ALT’ undeclared (first use in this function)
>   case BOOT_FROM_UART_ALT:
>        ^~~~~~~~~~~~~~~~~~
> arch/arm/mach-mvebu/spl.c:45:7: note: each undeclared identifier is reported only once for each function it appears in
> scripts/Makefile.build:280: recipe for target 'spl/arch/arm/mach-mvebu/spl.o' failed

Sorry about that.

> Could you please fix this by either adding this UART_ALT for other
> MVEBUs as well (AXP, I didn't check if its available), or restricting
> its usage on the A38x?

How about:

#ifdef BOOT_FROM_UART_ALT
    case BOOT_FROM_UART_ALT:
#endif
        return BOOT_DEVICE_UART;

> Please make sure that future patches are compile clean for at least
> all MVEBU targets.

Will do.

Thanks for testing and reviewing.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base
  2017-09-18 17:57   ` Baruch Siach
@ 2017-09-19  4:48     ` Stefan Roese
  2017-09-24 11:51       ` Baruch Siach
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Roese @ 2017-09-19  4:48 UTC (permalink / raw)
  To: u-boot

Hi Baruch,

On 18.09.2017 19:57, Baruch Siach wrote:
> On Mon, Sep 18, 2017 at 06:00:23PM +0200, Stefan Roese wrote:
>> On 20.08.2017 15:46, Baruch Siach wrote:
>>> The ClearFog Base boot from UART when setting the DIP switches to 01001.
>>> Unfortunately, the SPL code sometimes fails to detect the UART boot
>>> method at run-time. Add an alternative SAR UART boot value to fix this.
>>>
>>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>>> ---
>>>    arch/arm/mach-mvebu/include/mach/soc.h | 1 +
>>>    arch/arm/mach-mvebu/spl.c              | 1 +
>>>    2 files changed, 2 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
>>> index 0900e4008c12..44bac63b4447 100644
>>> --- a/arch/arm/mach-mvebu/include/mach/soc.h
>>> +++ b/arch/arm/mach-mvebu/include/mach/soc.h
>>> @@ -139,6 +139,7 @@
>>>    #define BOOT_DEV_SEL_MASK	(0x3f << BOOT_DEV_SEL_OFFS)
>>>    
>>>    #define BOOT_FROM_UART		0x28
>>> +#define BOOT_FROM_UART_ALT	0x3f
>>>    #define BOOT_FROM_SPI		0x32
>>>    #define BOOT_FROM_MMC		0x30
>>>    #define BOOT_FROM_MMC_ALT	0x31
>>> diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
>>> index 3cf02a54cea2..4b9c41360589 100644
>>> --- a/arch/arm/mach-mvebu/spl.c
>>> +++ b/arch/arm/mach-mvebu/spl.c
>>> @@ -42,6 +42,7 @@ static u32 get_boot_device(void)
>>>    		return BOOT_DEVICE_MMC1;
>>>    #endif
>>>    	case BOOT_FROM_UART:
>>> +	case BOOT_FROM_UART_ALT:
>>>    		return BOOT_DEVICE_UART;
>>>    	case BOOT_FROM_SPI:
>>>    	default:
>>
>> This patch produces this error for some MVEBU boards:
>>
>> [stefan at stefan-work u-boot-marvell (master)]$ make db-mv784mp-gp_defconfig
>>    HOSTCC  scripts/basic/fixdep
>>    HOSTCC  scripts/kconfig/conf.o
>>    SHIPPED scripts/kconfig/zconf.tab.c
>>    SHIPPED scripts/kconfig/zconf.lex.c
>>    SHIPPED scripts/kconfig/zconf.hash.c
>>    HOSTCC  scripts/kconfig/zconf.tab.o
>>    HOSTLD  scripts/kconfig/conf
>> #
>> # configuration written to .config
>> #
>> [stefan at stefan-work u-boot-marvell (master)]$ make -s -j10
>> arch/arm/mach-mvebu/spl.c: In function ‘get_boot_device’:
>> arch/arm/mach-mvebu/spl.c:45:7: error: ‘BOOT_FROM_UART_ALT’ undeclared (first use in this function)
>>    case BOOT_FROM_UART_ALT:
>>         ^~~~~~~~~~~~~~~~~~
>> arch/arm/mach-mvebu/spl.c:45:7: note: each undeclared identifier is reported only once for each function it appears in
>> scripts/Makefile.build:280: recipe for target 'spl/arch/arm/mach-mvebu/spl.o' failed
> 
> Sorry about that.
> 
>> Could you please fix this by either adding this UART_ALT for other
>> MVEBUs as well (AXP, I didn't check if its available), or restricting
>> its usage on the A38x?
> 
> How about:
> 
> #ifdef BOOT_FROM_UART_ALT
>      case BOOT_FROM_UART_ALT:
> #endif
>          return BOOT_DEVICE_UART;

If there is no such "alternative UART" for the other MVEBU SoCs (did
you check this btw?), then this is most likely the best solution.

Please resubmit v2 and I'll apply soon.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base
  2017-09-19  4:48     ` Stefan Roese
@ 2017-09-24 11:51       ` Baruch Siach
  0 siblings, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2017-09-24 11:51 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Tue, Sep 19, 2017 at 06:48:59AM +0200, Stefan Roese wrote:
> On 18.09.2017 19:57, Baruch Siach wrote:
> > On Mon, Sep 18, 2017 at 06:00:23PM +0200, Stefan Roese wrote:
> > > On 20.08.2017 15:46, Baruch Siach wrote:
> > > > The ClearFog Base boot from UART when setting the DIP switches to 01001.
> > > > Unfortunately, the SPL code sometimes fails to detect the UART boot
> > > > method at run-time. Add an alternative SAR UART boot value to fix this.
> > > > 
> > > > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > > > ---
> > > >    arch/arm/mach-mvebu/include/mach/soc.h | 1 +
> > > >    arch/arm/mach-mvebu/spl.c              | 1 +
> > > >    2 files changed, 2 insertions(+)
> > > > 
> > > > diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
> > > > index 0900e4008c12..44bac63b4447 100644
> > > > --- a/arch/arm/mach-mvebu/include/mach/soc.h
> > > > +++ b/arch/arm/mach-mvebu/include/mach/soc.h
> > > > @@ -139,6 +139,7 @@
> > > >    #define BOOT_DEV_SEL_MASK	(0x3f << BOOT_DEV_SEL_OFFS)
> > > >    #define BOOT_FROM_UART		0x28
> > > > +#define BOOT_FROM_UART_ALT	0x3f
> > > >    #define BOOT_FROM_SPI		0x32
> > > >    #define BOOT_FROM_MMC		0x30
> > > >    #define BOOT_FROM_MMC_ALT	0x31
> > > > diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
> > > > index 3cf02a54cea2..4b9c41360589 100644
> > > > --- a/arch/arm/mach-mvebu/spl.c
> > > > +++ b/arch/arm/mach-mvebu/spl.c
> > > > @@ -42,6 +42,7 @@ static u32 get_boot_device(void)
> > > >    		return BOOT_DEVICE_MMC1;
> > > >    #endif
> > > >    	case BOOT_FROM_UART:
> > > > +	case BOOT_FROM_UART_ALT:
> > > >    		return BOOT_DEVICE_UART;
> > > >    	case BOOT_FROM_SPI:
> > > >    	default:
> > > 
> > > This patch produces this error for some MVEBU boards:
> > > 
> > > [stefan at stefan-work u-boot-marvell (master)]$ make db-mv784mp-gp_defconfig
> > >    HOSTCC  scripts/basic/fixdep
> > >    HOSTCC  scripts/kconfig/conf.o
> > >    SHIPPED scripts/kconfig/zconf.tab.c
> > >    SHIPPED scripts/kconfig/zconf.lex.c
> > >    SHIPPED scripts/kconfig/zconf.hash.c
> > >    HOSTCC  scripts/kconfig/zconf.tab.o
> > >    HOSTLD  scripts/kconfig/conf
> > > #
> > > # configuration written to .config
> > > #
> > > [stefan at stefan-work u-boot-marvell (master)]$ make -s -j10
> > > arch/arm/mach-mvebu/spl.c: In function ‘get_boot_device’:
> > > arch/arm/mach-mvebu/spl.c:45:7: error: ‘BOOT_FROM_UART_ALT’ undeclared (first use in this function)
> > >    case BOOT_FROM_UART_ALT:
> > >         ^~~~~~~~~~~~~~~~~~
> > > arch/arm/mach-mvebu/spl.c:45:7: note: each undeclared identifier is reported only once for each function it appears in
> > > scripts/Makefile.build:280: recipe for target 'spl/arch/arm/mach-mvebu/spl.o' failed
> > 
> > Sorry about that.
> > 
> > > Could you please fix this by either adding this UART_ALT for other
> > > MVEBUs as well (AXP, I didn't check if its available), or restricting
> > > its usage on the A38x?
> > 
> > How about:
> > 
> > #ifdef BOOT_FROM_UART_ALT
> >      case BOOT_FROM_UART_ALT:
> > #endif
> >          return BOOT_DEVICE_UART;
> 
> If there is no such "alternative UART" for the other MVEBU SoCs (did
> you check this btw?), then this is most likely the best solution.

The relevant documentation appears to be table 48 in §7.5.1 of the 38x 
Hardware Specification. Unfortunately, the 0x3f value for the Boot Mode Select 
field is not documented there. I only found it in experimentation.

> Please resubmit v2 and I'll apply soon.

Will do after some more build and run-time testing.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-24 11:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-20 13:46 [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Baruch Siach
2017-08-20 13:46 ` [U-Boot] [PATCH 2/2] arm: mvebu: clearfog: document boot from UART Baruch Siach
2017-09-18 16:00 ` [U-Boot] [PATCH 1/2] arm: mvebu: fix boot from UART on ClearFog Base Stefan Roese
2017-09-18 17:57   ` Baruch Siach
2017-09-19  4:48     ` Stefan Roese
2017-09-24 11:51       ` Baruch Siach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.