diff mbox

[U-Boot,2/2] ARM: atmel: sama5d3xek: enable NOR flash support

Message ID 1403252161-20526-3-git-send-email-voice.shen@atmel.com
State Superseded, archived
Delegated to: Andreas Bießmann
Headers show

Commit Message

Bo Shen June 20, 2014, 8:16 a.m. UTC
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
 include/configs/sama5d3xek.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Andy Pont June 30, 2014, 9:55 a.m. UTC | #1
Hi Bo,

> -/* No NOR flash */
> +/* NOR flash */
> +#define CONFIG_CMD_FLASH
> +
> +#ifdef CONFIG_CMD_FLASH
> +#define CONFIG_SYS_FLASH_CFI
> +#define CONFIG_FLASH_CFI_DRIVER
> +#define CONFIG_SYS_FLASH_BASE		0x10000000
> +#define CONFIG_SYS_MAX_FLASH_SECT	0x20000
> +#define CONFIG_SYS_MAX_FLASH_BANKS	1
> +#else
>  #define CONFIG_SYS_NO_FLASH
> +#endif

The NOR flash device on the SAMA5D3x CPU modules supports hardware sector
protection and according to the flash datasheet: "All blocks power-up in a
locked state to protect array data from being altered during power
transitions".  In order to make your patch set work:

#define CONFIG_SYS_FLASH_PROTECTION

needs adding into the include/configs/sama5d3xek.h file.

Andy.
Bo Shen June 30, 2014, 10:01 a.m. UTC | #2
Hi Andy,

On 06/30/2014 05:55 PM, Andy Pont wrote:
> Hi Bo,
>
>> -/* No NOR flash */
>> +/* NOR flash */
>> +#define CONFIG_CMD_FLASH
>> +
>> +#ifdef CONFIG_CMD_FLASH
>> +#define CONFIG_SYS_FLASH_CFI
>> +#define CONFIG_FLASH_CFI_DRIVER
>> +#define CONFIG_SYS_FLASH_BASE		0x10000000
>> +#define CONFIG_SYS_MAX_FLASH_SECT	0x20000
>> +#define CONFIG_SYS_MAX_FLASH_BANKS	1
>> +#else
>>   #define CONFIG_SYS_NO_FLASH
>> +#endif
>
> The NOR flash device on the SAMA5D3x CPU modules supports hardware sector
> protection and according to the flash datasheet: "All blocks power-up in a
> locked state to protect array data from being altered during power
> transitions".  In order to make your patch set work:
>
> #define CONFIG_SYS_FLASH_PROTECTION
>
> needs adding into the include/configs/sama5d3xek.h file.

Thanks for your information.
I will add it into next version.
Thanks again.

> Andy.
>

Best Regards,
Bo Shen
Andy Pont June 30, 2014, 10:46 a.m. UTC | #3
Hi Bo,

> >> +#ifdef CONFIG_CMD_FLASH
> >> +#define CONFIG_SYS_FLASH_CFI
> >> +#define CONFIG_FLASH_CFI_DRIVER
> >> +#define CONFIG_SYS_FLASH_BASE		0x10000000
> >> +#define CONFIG_SYS_MAX_FLASH_SECT	0x20000

Is this the correct value for CONFIG_SYS_MAX_FLASH_SECT?  Shouldn't it be
127 (if we ignore the top boot block) or 131 if they are included?

Regards,

Andy.
Bo Shen July 1, 2014, 3:52 a.m. UTC | #4
Hi Andy,

On 06/30/2014 06:46 PM, Andy Pont wrote:
> Hi Bo,
>
>>>> +#ifdef CONFIG_CMD_FLASH
>>>> +#define CONFIG_SYS_FLASH_CFI
>>>> +#define CONFIG_FLASH_CFI_DRIVER
>>>> +#define CONFIG_SYS_FLASH_BASE		0x10000000
>>>> +#define CONFIG_SYS_MAX_FLASH_SECT	0x20000
>
> Is this the correct value for CONFIG_SYS_MAX_FLASH_SECT?  Shouldn't it be
> 127 (if we ignore the top boot block) or 131 if they are included?

oops, I fill this with the sector size.
Thanks point it out. Here, I think we should fill with 131.

> Regards,
>
> Andy.
>

Best Regards,
Bo Shen
diff mbox

Patch

diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index da27180..63d6775 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -79,8 +79,18 @@ 
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-/* No NOR flash */
+/* NOR flash */
+#define CONFIG_CMD_FLASH
+
+#ifdef CONFIG_CMD_FLASH
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_BASE		0x10000000
+#define CONFIG_SYS_MAX_FLASH_SECT	0x20000
+#define CONFIG_SYS_MAX_FLASH_BANKS	1
+#else
 #define CONFIG_SYS_NO_FLASH
+#endif
 
 /*
  * Command line configuration.