public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx:mx6slevk add spi nor boot support
@ 2014-12-30  3:14 Peng Fan
  2014-12-30 12:38 ` Jagan Teki
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2014-12-30  3:14 UTC (permalink / raw)
  To: u-boot

Add spi nor boot support for mx6slevk board.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
---
 board/freescale/mx6slevk/MAINTAINERS |  1 +
 configs/mx6slevk_spinor_defconfig    |  3 +++
 include/configs/mx6slevk.h           | 13 ++++++++++++-
 3 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 configs/mx6slevk_spinor_defconfig

diff --git a/board/freescale/mx6slevk/MAINTAINERS b/board/freescale/mx6slevk/MAINTAINERS
index 660af91..18d31a8 100644
--- a/board/freescale/mx6slevk/MAINTAINERS
+++ b/board/freescale/mx6slevk/MAINTAINERS
@@ -4,3 +4,4 @@ S:	Maintained
 F:	board/freescale/mx6slevk/
 F:	include/configs/mx6slevk.h
 F:	configs/mx6slevk_defconfig
+F:	configs/mx6slevk_spinor_defconfig
diff --git a/configs/mx6slevk_spinor_defconfig b/configs/mx6slevk_spinor_defconfig
new file mode 100644
index 0000000..93efe73
--- /dev/null
+++ b/configs/mx6slevk_spinor_defconfig
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL,SYS_BOOT_SPINOR"
+CONFIG_ARM=y
+CONFIG_TARGET_MX6SLEVK=y
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index e3e7f76..e6c4130 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -187,9 +187,20 @@
 /* FLASH and environment organization */
 #define CONFIG_SYS_NO_FLASH
 
-#define CONFIG_ENV_OFFSET		(6 * SZ_64K)
 #define CONFIG_ENV_SIZE			SZ_8K
+
+#if defined CONFIG_SYS_BOOT_SPINOR
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET               (768 * 1024)
+#define CONFIG_ENV_SECT_SIZE            (64 * 1024)
+#define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
+#define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
+#define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
+#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
+#else
+#define CONFIG_ENV_OFFSET		(6 * SZ_64K)
 #define CONFIG_ENV_IS_IN_MMC
+#endif
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ
-- 
1.8.4

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

* [U-Boot] [PATCH] imx:mx6slevk add spi nor boot support
  2014-12-30  3:14 [U-Boot] [PATCH] imx:mx6slevk add spi nor boot support Peng Fan
@ 2014-12-30 12:38 ` Jagan Teki
  2014-12-31  3:26   ` Peng Fan
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2014-12-30 12:38 UTC (permalink / raw)
  To: u-boot

On 30 December 2014 at 08:44, Peng Fan <Peng.Fan@freescale.com> wrote:
> Add spi nor boot support for mx6slevk board.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> ---
>  board/freescale/mx6slevk/MAINTAINERS |  1 +
>  configs/mx6slevk_spinor_defconfig    |  3 +++
>  include/configs/mx6slevk.h           | 13 ++++++++++++-
>  3 files changed, 16 insertions(+), 1 deletion(-)
>  create mode 100644 configs/mx6slevk_spinor_defconfig
>
> diff --git a/board/freescale/mx6slevk/MAINTAINERS b/board/freescale/mx6slevk/MAINTAINERS
> index 660af91..18d31a8 100644
> --- a/board/freescale/mx6slevk/MAINTAINERS
> +++ b/board/freescale/mx6slevk/MAINTAINERS
> @@ -4,3 +4,4 @@ S:      Maintained
>  F:     board/freescale/mx6slevk/
>  F:     include/configs/mx6slevk.h
>  F:     configs/mx6slevk_defconfig
> +F:     configs/mx6slevk_spinor_defconfig
> diff --git a/configs/mx6slevk_spinor_defconfig b/configs/mx6slevk_spinor_defconfig
> new file mode 100644
> index 0000000..93efe73
> --- /dev/null
> +++ b/configs/mx6slevk_spinor_defconfig
> @@ -0,0 +1,3 @@
> +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL,SYS_BOOT_SPINOR"
> +CONFIG_ARM=y
> +CONFIG_TARGET_MX6SLEVK=y
> diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
> index e3e7f76..e6c4130 100644
> --- a/include/configs/mx6slevk.h
> +++ b/include/configs/mx6slevk.h
> @@ -187,9 +187,20 @@
>  /* FLASH and environment organization */
>  #define CONFIG_SYS_NO_FLASH
>
> -#define CONFIG_ENV_OFFSET              (6 * SZ_64K)
>  #define CONFIG_ENV_SIZE                        SZ_8K
> +
> +#if defined CONFIG_SYS_BOOT_SPINOR
> +#define CONFIG_ENV_IS_IN_SPI_FLASH
> +#define CONFIG_ENV_OFFSET               (768 * 1024)
> +#define CONFIG_ENV_SECT_SIZE            (64 * 1024)
> +#define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
> +#define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
> +#define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
> +#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED

If you need default values may be you couldn't define these so-that
common/env_sf.c
will take the defaults for undefs - please check.

> +#else
> +#define CONFIG_ENV_OFFSET              (6 * SZ_64K)
>  #define CONFIG_ENV_IS_IN_MMC
> +#endif
>
>  #define CONFIG_OF_LIBFDT
>  #define CONFIG_CMD_BOOTZ
> --
> 1.8.4
>

thanks!
-- 
Jagan.

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

* [U-Boot] [PATCH] imx:mx6slevk add spi nor boot support
  2014-12-30 12:38 ` Jagan Teki
@ 2014-12-31  3:26   ` Peng Fan
  2014-12-31  9:31     ` Jagan Teki
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2014-12-31  3:26 UTC (permalink / raw)
  To: u-boot

Hi Jagan,

On 12/30/2014 8:38 PM, Jagan Teki wrote:
> On 30 December 2014 at 08:44, Peng Fan <Peng.Fan@freescale.com> wrote:
>> Add spi nor boot support for mx6slevk board.
>>
>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>> ---
>>   board/freescale/mx6slevk/MAINTAINERS |  1 +
>>   configs/mx6slevk_spinor_defconfig    |  3 +++
>>   include/configs/mx6slevk.h           | 13 ++++++++++++-
>>   3 files changed, 16 insertions(+), 1 deletion(-)
>>   create mode 100644 configs/mx6slevk_spinor_defconfig
>>
>> diff --git a/board/freescale/mx6slevk/MAINTAINERS b/board/freescale/mx6slevk/MAINTAINERS
>> index 660af91..18d31a8 100644
>> --- a/board/freescale/mx6slevk/MAINTAINERS
>> +++ b/board/freescale/mx6slevk/MAINTAINERS
>> @@ -4,3 +4,4 @@ S:      Maintained
>>   F:     board/freescale/mx6slevk/
>>   F:     include/configs/mx6slevk.h
>>   F:     configs/mx6slevk_defconfig
>> +F:     configs/mx6slevk_spinor_defconfig
>> diff --git a/configs/mx6slevk_spinor_defconfig b/configs/mx6slevk_spinor_defconfig
>> new file mode 100644
>> index 0000000..93efe73
>> --- /dev/null
>> +++ b/configs/mx6slevk_spinor_defconfig
>> @@ -0,0 +1,3 @@
>> +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL,SYS_BOOT_SPINOR"
>> +CONFIG_ARM=y
>> +CONFIG_TARGET_MX6SLEVK=y
>> diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
>> index e3e7f76..e6c4130 100644
>> --- a/include/configs/mx6slevk.h
>> +++ b/include/configs/mx6slevk.h
>> @@ -187,9 +187,20 @@
>>   /* FLASH and environment organization */
>>   #define CONFIG_SYS_NO_FLASH
>>
>> -#define CONFIG_ENV_OFFSET              (6 * SZ_64K)
>>   #define CONFIG_ENV_SIZE                        SZ_8K
>> +
>> +#if defined CONFIG_SYS_BOOT_SPINOR
>> +#define CONFIG_ENV_IS_IN_SPI_FLASH
>> +#define CONFIG_ENV_OFFSET               (768 * 1024)
>> +#define CONFIG_ENV_SECT_SIZE            (64 * 1024)
>> +#define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
>> +#define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
>> +#define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
>> +#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
>
> If you need default values may be you couldn't define these so-that
> common/env_sf.c
> will take the defaults for undefs - please check.
>

Default values are defined in mx6slevk.h

#define CONFIG_SF_DEFAULT_BUS  0
#define CONFIG_SF_DEFAULT_CS   0
#define CONFIG_SF_DEFAULT_SPEED 20000000
#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0

In env_sf.c
I did not see any undefs, there is only a piece of code like:
#ifndef CONFIG_ENV_SPI_BUS
#define CONFIG_ENV_SPI_BUS 0
#endif

>> +#else
>> +#define CONFIG_ENV_OFFSET              (6 * SZ_64K)
>>   #define CONFIG_ENV_IS_IN_MMC
>> +#endif
>>
>>   #define CONFIG_OF_LIBFDT
>>   #define CONFIG_CMD_BOOTZ
>> --
>> 1.8.4
>>
>
> thanks!
>
Regards,
Peng Fan

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

* [U-Boot] [PATCH] imx:mx6slevk add spi nor boot support
  2014-12-31  3:26   ` Peng Fan
@ 2014-12-31  9:31     ` Jagan Teki
  0 siblings, 0 replies; 4+ messages in thread
From: Jagan Teki @ 2014-12-31  9:31 UTC (permalink / raw)
  To: u-boot

On 31 December 2014 at 08:56, Peng Fan <B51431@freescale.com> wrote:
> Hi Jagan,
>
>
> On 12/30/2014 8:38 PM, Jagan Teki wrote:
>>
>> On 30 December 2014 at 08:44, Peng Fan <Peng.Fan@freescale.com> wrote:
>>>
>>> Add spi nor boot support for mx6slevk board.
>>>
>>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>>> ---
>>>   board/freescale/mx6slevk/MAINTAINERS |  1 +
>>>   configs/mx6slevk_spinor_defconfig    |  3 +++
>>>   include/configs/mx6slevk.h           | 13 ++++++++++++-
>>>   3 files changed, 16 insertions(+), 1 deletion(-)
>>>   create mode 100644 configs/mx6slevk_spinor_defconfig
>>>
>>> diff --git a/board/freescale/mx6slevk/MAINTAINERS
>>> b/board/freescale/mx6slevk/MAINTAINERS
>>> index 660af91..18d31a8 100644
>>> --- a/board/freescale/mx6slevk/MAINTAINERS
>>> +++ b/board/freescale/mx6slevk/MAINTAINERS
>>> @@ -4,3 +4,4 @@ S:      Maintained
>>>   F:     board/freescale/mx6slevk/
>>>   F:     include/configs/mx6slevk.h
>>>   F:     configs/mx6slevk_defconfig
>>> +F:     configs/mx6slevk_spinor_defconfig
>>> diff --git a/configs/mx6slevk_spinor_defconfig
>>> b/configs/mx6slevk_spinor_defconfig
>>> new file mode 100644
>>> index 0000000..93efe73
>>> --- /dev/null
>>> +++ b/configs/mx6slevk_spinor_defconfig
>>> @@ -0,0 +1,3 @@
>>>
>>> +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL,SYS_BOOT_SPINOR"
>>> +CONFIG_ARM=y
>>> +CONFIG_TARGET_MX6SLEVK=y
>>> diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
>>> index e3e7f76..e6c4130 100644
>>> --- a/include/configs/mx6slevk.h
>>> +++ b/include/configs/mx6slevk.h
>>> @@ -187,9 +187,20 @@
>>>   /* FLASH and environment organization */
>>>   #define CONFIG_SYS_NO_FLASH
>>>
>>> -#define CONFIG_ENV_OFFSET              (6 * SZ_64K)
>>>   #define CONFIG_ENV_SIZE                        SZ_8K
>>> +
>>> +#if defined CONFIG_SYS_BOOT_SPINOR
>>> +#define CONFIG_ENV_IS_IN_SPI_FLASH
>>> +#define CONFIG_ENV_OFFSET               (768 * 1024)
>>> +#define CONFIG_ENV_SECT_SIZE            (64 * 1024)
>>> +#define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
>>> +#define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
>>> +#define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
>>> +#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
>>
>>
>> If you need default values may be you couldn't define these so-that
>> common/env_sf.c
>> will take the defaults for undefs - please check.
>>
>
> Default values are defined in mx6slevk.h
>
> #define CONFIG_SF_DEFAULT_BUS  0
> #define CONFIG_SF_DEFAULT_CS   0
> #define CONFIG_SF_DEFAULT_SPEED 20000000
> #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
>
> In env_sf.c
> I did not see any undefs, there is only a piece of code like:
> #ifndef CONFIG_ENV_SPI_BUS
> #define CONFIG_ENV_SPI_BUS 0
> #endif
>
>>> +#else
>>> +#define CONFIG_ENV_OFFSET              (6 * SZ_64K)
>>>   #define CONFIG_ENV_IS_IN_MMC
>>> +#endif
>>>
>>>   #define CONFIG_OF_LIBFDT
>>>   #define CONFIG_CMD_BOOTZ
>>> --
>>> 1.8.4

Applied to u-boot-spi/master

thanks!
-- 
Jagan.

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

end of thread, other threads:[~2014-12-31  9:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30  3:14 [U-Boot] [PATCH] imx:mx6slevk add spi nor boot support Peng Fan
2014-12-30 12:38 ` Jagan Teki
2014-12-31  3:26   ` Peng Fan
2014-12-31  9:31     ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox