diff mbox

[U-Boot,7/7] spi: altera: Move the config options to the top

Message ID 1414007764-24094-7-git-send-email-marex@denx.de
State Accepted
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Marek Vasut Oct. 22, 2014, 7:56 p.m. UTC
Just move the configuration options scattered all over the driver
to the top of the source file. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Pavel Machek <pavel@denx.de>
Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
---
 drivers/spi/altera_spi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Jagan Teki Oct. 27, 2014, 5:11 p.m. UTC | #1
On 23 October 2014 01:26, Marek Vasut <marex@denx.de> wrote:
> Just move the configuration options scattered all over the driver
> to the top of the source file. No functional change.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@altera.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
> ---
>  drivers/spi/altera_spi.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
> index 93365c2..8f31507 100644
> --- a/drivers/spi/altera_spi.c
> +++ b/drivers/spi/altera_spi.c
> @@ -13,6 +13,14 @@
>  #include <malloc.h>
>  #include <spi.h>
>
> +#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
> +#define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
> +#endif
> +
> +#ifndef CONFIG_SYS_ALTERA_SPI_LIST
> +#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
> +#endif
> +
>  struct altera_spi_regs {
>         u32     rxdata;
>         u32     txdata;
> @@ -36,10 +44,6 @@ struct altera_spi_regs {
>  #define ALTERA_SPI_CONTROL_IE_MSK      (1 << 8)
>  #define ALTERA_SPI_CONTROL_SSO_MSK     (1 << 10)
>
> -#ifndef CONFIG_SYS_ALTERA_SPI_LIST
> -#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
> -#endif
> -
>  static ulong altera_spi_base_list[] = CONFIG_SYS_ALTERA_SPI_LIST;
>
>  struct altera_spi_slave {
> @@ -118,10 +122,6 @@ void spi_release_bus(struct spi_slave *slave)
>         writel(0, &altspi->regs->slave_sel);
>  }
>
> -#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
> -# define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
> -#endif
> -
>  int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
>              void *din, unsigned long flags)
>  {
> --
> 2.0.0
>

Series missing's - cover letter and v2 change log.

Applied to u-boot-spi/master

thanks!
Dinh Nguyen Nov. 6, 2014, 11:03 p.m. UTC | #2
Hi Marek,

Have you been able to successfully boot Linux using the mainline uboot?
I cannot seem to be able to boot linux on the C5 SocDK.

It starts to boot linux, but then reboots after a bit back into u-boot.
So I commented out #define CONFIG_HW_WATCHDOG in
include/configs/socfpga_cyclone5.h. That helped so that I can look that
__log_buf.
I was able to trace it down that it was not able to get a tty console,
because serial8250_console_setup() is failing at:

if (!port->iobase && !port->membase)

For reasons I haven't figured out yet, both port->iobase and
port->membase are NULL.

So no debug console, but Linux is able to boot all the way to the point
of tyring to mount a FS.

Perhaps some kind of memory setup issue? I've seen a thread where
Chin-Liang was able to boot, but I don't know if he did any other tricks.

Just wondering if I'm missing a patch or something?

Thanks,
Dinh
Anatolij Gustschin Nov. 6, 2014, 11:40 p.m. UTC | #3
Hi Dinh,

On Thu, 6 Nov 2014 17:03:48 -0600
Dinh Nguyen <dinguyen@opensource.altera.com> wrote:

> Hi Marek,
> 
> Have you been able to successfully boot Linux using the mainline uboot?
> I cannot seem to be able to boot linux on the C5 SocDK.
> 
> It starts to boot linux, but then reboots after a bit back into u-boot.
> So I commented out #define CONFIG_HW_WATCHDOG in
> include/configs/socfpga_cyclone5.h. That helped so that I can look that
> __log_buf.
> I was able to trace it down that it was not able to get a tty console,
> because serial8250_console_setup() is failing at:
> 
> if (!port->iobase && !port->membase)
> 
> For reasons I haven't figured out yet, both port->iobase and
> port->membase are NULL.
> 
> So no debug console, but Linux is able to boot all the way to the point
> of tyring to mount a FS.
> 
> Perhaps some kind of memory setup issue? I've seen a thread where
> Chin-Liang was able to boot, but I don't know if he did any other tricks.
> 
> Just wondering if I'm missing a patch or something?

the issue could be the wrong console= argument on the kernel command
line. In the current socfpga_config5.h I see

  #define CONFIG_BOOTARGS         "console=ttyS0" __stringify(CONFIG_BAUDRATE)

A comma is missing after "console=ttyS0"

It should be

  #define CONFIG_BOOTARGS         "console=ttyS0," __stringify(CONFIG_BAUDRATE)

Could you please test it? Thanks.

Best regards,

Anatolij
Dinh Nguyen Nov. 6, 2014, 11:54 p.m. UTC | #4
On 11/06/2014 05:40 PM, Anatolij Gustschin wrote:
> Hi Dinh,
> 
> On Thu, 6 Nov 2014 17:03:48 -0600
> Dinh Nguyen <dinguyen@opensource.altera.com> wrote:
> 
>> Hi Marek,
>>
>> Have you been able to successfully boot Linux using the mainline uboot?
>> I cannot seem to be able to boot linux on the C5 SocDK.
>>
>> It starts to boot linux, but then reboots after a bit back into u-boot.
>> So I commented out #define CONFIG_HW_WATCHDOG in
>> include/configs/socfpga_cyclone5.h. That helped so that I can look that
>> __log_buf.
>> I was able to trace it down that it was not able to get a tty console,
>> because serial8250_console_setup() is failing at:
>>
>> if (!port->iobase && !port->membase)
>>
>> For reasons I haven't figured out yet, both port->iobase and
>> port->membase are NULL.
>>
>> So no debug console, but Linux is able to boot all the way to the point
>> of tyring to mount a FS.
>>
>> Perhaps some kind of memory setup issue? I've seen a thread where
>> Chin-Liang was able to boot, but I don't know if he did any other tricks.
>>
>> Just wondering if I'm missing a patch or something?
> 
> the issue could be the wrong console= argument on the kernel command
> line. In the current socfpga_config5.h I see
> 
>   #define CONFIG_BOOTARGS         "console=ttyS0" __stringify(CONFIG_BAUDRATE)
> 
> A comma is missing after "console=ttyS0"
> 
> It should be
> 
>   #define CONFIG_BOOTARGS         "console=ttyS0," __stringify(CONFIG_BAUDRATE)
> 
> Could you please test it? Thanks.

Yep, that was it! Thanks alot for seeing that.

Dinh
Marek Vasut Nov. 7, 2014, 7:24 a.m. UTC | #5
On Friday, November 07, 2014 at 12:54:14 AM, Dinh Nguyen wrote:
> On 11/06/2014 05:40 PM, Anatolij Gustschin wrote:
> > Hi Dinh,
> > 
> > On Thu, 6 Nov 2014 17:03:48 -0600
> > 
> > Dinh Nguyen <dinguyen@opensource.altera.com> wrote:
> >> Hi Marek,
> >> 
> >> Have you been able to successfully boot Linux using the mainline uboot?
> >> I cannot seem to be able to boot linux on the C5 SocDK.
> >> 
> >> It starts to boot linux, but then reboots after a bit back into u-boot.
> >> So I commented out #define CONFIG_HW_WATCHDOG in
> >> include/configs/socfpga_cyclone5.h. That helped so that I can look that
> >> __log_buf.
> >> I was able to trace it down that it was not able to get a tty console,
> >> because serial8250_console_setup() is failing at:
> >> 
> >> if (!port->iobase && !port->membase)
> >> 
> >> For reasons I haven't figured out yet, both port->iobase and
> >> port->membase are NULL.
> >> 
> >> So no debug console, but Linux is able to boot all the way to the point
> >> of tyring to mount a FS.
> >> 
> >> Perhaps some kind of memory setup issue? I've seen a thread where
> >> Chin-Liang was able to boot, but I don't know if he did any other
> >> tricks.
> >> 
> >> Just wondering if I'm missing a patch or something?
> > 
> > the issue could be the wrong console= argument on the kernel command
> > line. In the current socfpga_config5.h I see
> > 
> >   #define CONFIG_BOOTARGS         "console=ttyS0"
> >   __stringify(CONFIG_BAUDRATE)
> > 
> > A comma is missing after "console=ttyS0"
> > 
> > It should be
> > 
> >   #define CONFIG_BOOTARGS         "console=ttyS0,"
> >   __stringify(CONFIG_BAUDRATE)
> > 
> > Could you please test it? Thanks.
> 
> Yep, that was it! Thanks alot for seeing that.

Thanks for spotting this, I'll pick the patch for Anatolij.

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index 93365c2..8f31507 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -13,6 +13,14 @@ 
 #include <malloc.h>
 #include <spi.h>
 
+#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
+#define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
+#endif
+
+#ifndef CONFIG_SYS_ALTERA_SPI_LIST
+#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
+#endif
+
 struct altera_spi_regs {
 	u32	rxdata;
 	u32	txdata;
@@ -36,10 +44,6 @@  struct altera_spi_regs {
 #define ALTERA_SPI_CONTROL_IE_MSK	(1 << 8)
 #define ALTERA_SPI_CONTROL_SSO_MSK	(1 << 10)
 
-#ifndef CONFIG_SYS_ALTERA_SPI_LIST
-#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
-#endif
-
 static ulong altera_spi_base_list[] = CONFIG_SYS_ALTERA_SPI_LIST;
 
 struct altera_spi_slave {
@@ -118,10 +122,6 @@  void spi_release_bus(struct spi_slave *slave)
 	writel(0, &altspi->regs->slave_sel);
 }
 
-#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
-# define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
-#endif
-
 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 	     void *din, unsigned long flags)
 {