mtd: rawnand: denali: Do not reset the block before booting the kernel
authorMarek Vasut <marex@denx.de>
Tue, 21 Jan 2020 19:03:11 +0000 (20:03 +0100)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 31 Jan 2020 16:14:32 +0000 (01:14 +0900)
The Denali NAND driver in mainline Linux currently cannot deassert the
reset. The upcoming Linux 5.6 will support the reset controlling, and
also set up SPARE_AREA_SKIP_BYTES correctly. So, the Denali driver in
the future kernel will work without relying on any bootloader or firmware.
However, we still need to take care of stable kernel versions for a while.
U-boot should not assert the reset of this controller.

Fixes: ed784ac3822b ("mtd: rawnand: denali: add reset handling")
Signed-off-by: Marek Vasut <marex@denx.de>
[yamada.masahiro: reword the commit description]
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mtd/nand/raw/denali.h
drivers/mtd/nand/raw/denali_dt.c

index 63ae828768c95c40f0d5ecb257561f9d968369cf..019deda094e5de952ad9725d4d4968aad9df764a 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/bitops.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/types.h>
-#include <reset.h>
 
 #define DEVICE_RESET                           0x0
 #define     DEVICE_RESET__BANK(bank)                   BIT(bank)
@@ -316,7 +315,6 @@ struct denali_nand_info {
        void (*host_write)(struct denali_nand_info *denali, u32 addr, u32 data);
        void (*setup_dma)(struct denali_nand_info *denali, dma_addr_t dma_addr,
                          int page, int write);
-       struct reset_ctl_bulk resets;
 };
 
 #define DENALI_CAP_HW_ECC_FIXUP                        BIT(0)
index b1e14982c443fd1d55677e8805733a73089aee25..91d0f20aaeb073304c361a6ce80b27c969e2fafc 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/io.h>
 #include <linux/ioport.h>
 #include <linux/printk.h>
+#include <reset.h>
 
 #include "denali.h"
 
@@ -63,6 +64,7 @@ static int denali_dt_probe(struct udevice *dev)
        struct denali_nand_info *denali = dev_get_priv(dev);
        const struct denali_dt_data *data;
        struct clk clk, clk_x, clk_ecc;
+       struct reset_ctl_bulk resets;
        struct resource res;
        int ret;
 
@@ -133,30 +135,21 @@ static int denali_dt_probe(struct udevice *dev)
                denali->clk_x_rate = 200000000;
        }
 
-       ret = reset_get_bulk(dev, &denali->resets);
+       ret = reset_get_bulk(dev, &resets);
        if (ret)
                dev_warn(dev, "Can't get reset: %d\n", ret);
        else
-               reset_deassert_bulk(&denali->resets);
+               reset_deassert_bulk(&resets);
 
        return denali_init(denali);
 }
 
-static int denali_dt_remove(struct udevice *dev)
-{
-       struct denali_nand_info *denali = dev_get_priv(dev);
-
-       return reset_release_bulk(&denali->resets);
-}
-
 U_BOOT_DRIVER(denali_nand_dt) = {
        .name = "denali-nand-dt",
        .id = UCLASS_MISC,
        .of_match = denali_nand_dt_ids,
        .probe = denali_dt_probe,
        .priv_auto_alloc_size = sizeof(struct denali_nand_info),
-       .remove = denali_dt_remove,
-       .flags = DM_FLAG_OS_PREPARE,
 };
 
 void board_nand_init(void)