]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: at91sam9260ek: Use SPI-flash-based AT45xxx DataFlash
authorWenyou.Yang@microchip.com <Wenyou.Yang@microchip.com>
Fri, 21 Jul 2017 05:40:11 +0000 (13:40 +0800)
committerTom Rini <trini@konsulko.com>
Sat, 5 Aug 2017 00:38:36 +0000 (20:38 -0400)
To support driver model and device tree, use the SPI-flash-based
AT45xxx DataFlash driver, DataFlash is a kind of SPI flash.
Instead of ATMEL_DATAFLASH_SPI DataFlash older driver that will
be removed in the future.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 files changed:
arch/arm/dts/at91sam9260.dtsi
arch/arm/dts/at91sam9260ek.dts
arch/arm/dts/at91sam9g20ek_common.dtsi
board/atmel/at91sam9260ek/at91sam9260ek.c
configs/at91sam9260ek_dataflash_cs0_defconfig
configs/at91sam9260ek_dataflash_cs1_defconfig
configs/at91sam9260ek_nandflash_defconfig
configs/at91sam9g20ek_2mmc_defconfig
configs/at91sam9g20ek_2mmc_nandflash_defconfig
configs/at91sam9g20ek_dataflash_cs0_defconfig
configs/at91sam9g20ek_dataflash_cs1_defconfig
configs/at91sam9g20ek_nandflash_defconfig
configs/at91sam9xeek_dataflash_cs0_defconfig
configs/at91sam9xeek_dataflash_cs1_defconfig
configs/at91sam9xeek_nandflash_defconfig
include/configs/at91sam9260ek.h

index 0f25e336dab527fdcf7d0e8688b94b758c092cf3..69d9ceadaff450b192a8d4e95c0035561c0c3dfb 100644 (file)
@@ -34,6 +34,7 @@
                tcb1 = &tcb1;
                i2c0 = &i2c0;
                ssc0 = &ssc0;
+               spi0 = &spi0;
        };
        cpus {
                #address-cells = <0>;
index 086c8eae1c10222be1620819f3d8543370187caf..67a2660c80d1b6a66cc3cc87c9e0c4059019d179 100644 (file)
                                cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
                                mtd_dataflash@0 {
                                        compatible = "atmel,at45", "atmel,dataflash";
-                                       spi-max-frequency = <50000000>;
+                                       spi-max-frequency = <15000000>;
                                        reg = <1>;
                                };
                        };
index 65ae09911905c0948fad6b72061b66dfe13b112d..9db245e442c8d685db2fe2de8133ccc63d7ce78f 100644 (file)
@@ -99,7 +99,7 @@
                                cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
                                mtd_dataflash@0 {
                                        compatible = "atmel,at45", "atmel,dataflash";
-                                       spi-max-frequency = <50000000>;
+                                       spi-max-frequency = <15000000>;
                                        reg = <1>;
                                };
                        };
index b087fce9b8767c24ff239efc5f0fc5487b9de499..d3ce947acf370298ccd1610338e7cb246b5d0043 100644 (file)
@@ -87,10 +87,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
        at91sam9260ek_nand_hw_init();
 #endif
-#ifdef CONFIG_HAS_DATAFLASH
-       at91_spi0_hw_init((1 << 0) | (1 << 1));
-#endif
-
        return 0;
 }
 
index aacaf179c33dc5e77989d2156263f20e8f7170b4..b356443c0ececb51f0fee11ead665cf62a22f568 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9260,SYS_USE_DATAFLASH_CS0"
-CONFIG_ENV_IS_IN_DATAFLASH=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index f9a9042892e83dccc7c91c7755a202ed64f8fd4e..98bcdadf189bd6cf6006f06a1de099ed9ffc245a 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9260,SYS_USE_DATAFLASH_CS1"
-CONFIG_ENV_IS_IN_DATAFLASH=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index 972d10ef83c215664a0bfcf3056946d7dbfc258b..312d820d7876352d0cef29b110bf1fa9f9368f44 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index 93f156f4a9a338f7beb0776a1396350923697fff..2313710e128122581cde89b94eca922350ad0c94 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -31,6 +32,10 @@ CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -42,6 +47,8 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
index 5f18f08f1536c1cbb8d745d0ead3047b984629b9..c0094855c0c17df40911b3df5f67eec0091184dd 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -31,6 +32,10 @@ CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -42,6 +47,8 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
index 5908c6dbfc0272f22b08914be52f39bc2164c743..da86e8ce38a9a91d048e6f895da8ae2e3072b03d 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20ek"
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,SYS_USE_DATAFLASH_CS0"
-CONFIG_ENV_IS_IN_DATAFLASH=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index 39e4881373c269d621a0ce6d38fe6127a657eb7d..7a46152acdee3e59aea467b0a7b23cc43db63a09 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20ek"
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,SYS_USE_DATAFLASH_CS1"
-CONFIG_ENV_IS_IN_DATAFLASH=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index df51bbc1c51e4406ac891701cbb626c7a0a0948a..04cd2b2a203bb0a3e92e1afca7ee05900defc85d 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index b2a8319d1c1ae4e254e050d5c994af1bb3447fba..0afd2459c93e732b7ddc65443959d464424d8f76 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9XE,SYS_USE_DATAFLASH_CS0"
-CONFIG_ENV_IS_IN_DATAFLASH=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index ee137a842728c4fa6828c458bfda1b97648ce282..e000b25e2516764596fd37f078be5468048bc415 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9XE,SYS_USE_DATAFLASH_CS1"
-CONFIG_ENV_IS_IN_DATAFLASH=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index b48755c9f1853f0c135a906d1d5ca1523bb66626..4ef55ead7659270fcae6d4db5df0666ea7ff1554 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
@@ -29,6 +30,10 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
@@ -40,5 +45,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
+CONFIG_DM_SPI=y
+CONFIG_ATMEL_SPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
index 00efcf032d40f80e22429540ce6f32aa31e4df19..8238dcc78fca7a18d5630eab1344da0e7f5f84b6 100644 (file)
 # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
 #endif
 
-#ifndef CONFIG_AT91SAM9G20EK_2MMC
-/* DataFlash */
-#define CONFIG_ATMEL_DATAFLASH_SPI
-#define CONFIG_HAS_DATAFLASH           1
-#define CONFIG_SYS_MAX_DATAFLASH_BANKS         2
-#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
-#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1    0xD0000000      /* CS1 */
-#define AT91_SPI_CLK                   15000000
-#else
-/* Enable MMC. The MCCK is conflicted with DataFlash */
-#endif
-
-#ifdef CONFIG_AT91SAM9G20EK
-#define DATAFLASH_TCSS                 (0x22 << 16)
-#else
-#define DATAFLASH_TCSS                 (0x1a << 16)
-#endif
-#define DATAFLASH_TCHS                 (0x1 << 24)
-
 /* NAND flash */
 #ifdef CONFIG_CMD_NAND
 #define CONFIG_NAND_ATMEL
 #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
-#define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-#define CONFIG_ENV_OFFSET              0x4200
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_OFFSET      0x4200
 #define CONFIG_ENV_SIZE                0x4200
-#define CONFIG_BOOTCOMMAND     "cp.b 0xC0084000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SECT_SIZE   0x210
+#define CONFIG_ENV_SPI_MAX_HZ  15000000
+#define CONFIG_BOOTCOMMAND     "sf probe 0:0; " \
+                               "sf read 0x22000000 0x84000 0x294000; " \
+                               "bootm 0x22000000"
 #define CONFIG_BOOTARGS                "console=ttyS0,115200 "                 \
                                "root=/dev/mtdblock0 "                  \
                                "mtdparts=atmel_nand:-(root) "          \
 
 #elif CONFIG_SYS_USE_DATAFLASH_CS1
 
-/* bootstrap + u-boot + env + linux in dataflash on CS1 */
-#define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
-#define CONFIG_ENV_OFFSET              0x4200
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_OFFSET      0x4200
 #define CONFIG_ENV_SIZE                0x4200
-#define CONFIG_BOOTCOMMAND     "cp.b 0xD0084000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SECT_SIZE   0x210
+#define CONFIG_ENV_SPI_MAX_HZ  15000000
+#define CONFIG_BOOTCOMMAND     "sf probe 0:1; " \
+                               "sf read 0x22000000 0x84000 0x294000; " \
+                               "bootm 0x22000000"
 #define CONFIG_BOOTARGS                "console=ttyS0,115200 "                 \
                                "root=/dev/mtdblock0 "                  \
                                "mtdparts=atmel_nand:-(root) "          \