Skip to content

Commit e816684

Browse files
Merge remote-tracking branch 'korg_git/nand/next' into mtd/next
2 parents ad9b10d + e16ecee commit e816684

File tree

11 files changed

+391
-62
lines changed

11 files changed

+391
-62
lines changed

Documentation/devicetree/bindings/mtd/mxc-nand.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,4 @@ examples:
3737
compatible = "fsl,imx27-nand";
3838
reg = <0xd8000000 0x1000>;
3939
interrupts = <29>;
40-
nand-bus-width = <8>;
41-
nand-ecc-mode = "hw";
4240
};

Documentation/devicetree/bindings/mtd/qcom,nandc.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,31 @@ allOf:
102102
- const: rx
103103
- const: cmd
104104

105+
- if:
106+
properties:
107+
compatible:
108+
contains:
109+
enum:
110+
- qcom,ipq806x-nand
111+
112+
then:
113+
properties:
114+
qcom,boot-partitions:
115+
$ref: /schemas/types.yaml#/definitions/uint32-matrix
116+
items:
117+
items:
118+
- description: offset
119+
- description: size
120+
description:
121+
Boot partition use a different layout where the 4 bytes of spare
122+
data are not protected by ECC. Use this to declare these special
123+
partitions by defining first the offset and then the size.
124+
125+
It's in the form of <offset1 size1 offset2 size2 offset3 ...>
126+
and should be declared in ascending order.
127+
128+
Refer to the ipq8064 example on how to use this special binding.
129+
105130
required:
106131
- compatible
107132
- reg
@@ -135,6 +160,8 @@ examples:
135160
nand-ecc-strength = <4>;
136161
nand-bus-width = <8>;
137162
163+
qcom,boot-partitions = <0x0 0x58a0000>;
164+
138165
partitions {
139166
compatible = "fixed-partitions";
140167
#address-cells = <1>;

drivers/mtd/nand/raw/arasan-nand-controller.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ static int anfc_select_target(struct nand_chip *chip, int target)
347347

348348
/* Update clock frequency */
349349
if (nfc->cur_clk != anand->clk) {
350-
clk_disable_unprepare(nfc->controller_clk);
351-
ret = clk_set_rate(nfc->controller_clk, anand->clk);
350+
clk_disable_unprepare(nfc->bus_clk);
351+
ret = clk_set_rate(nfc->bus_clk, anand->clk);
352352
if (ret) {
353353
dev_err(nfc->dev, "Failed to change clock rate\n");
354354
return ret;
355355
}
356356

357-
ret = clk_prepare_enable(nfc->controller_clk);
357+
ret = clk_prepare_enable(nfc->bus_clk);
358358
if (ret) {
359359
dev_err(nfc->dev,
360-
"Failed to re-enable the controller clock\n");
360+
"Failed to re-enable the bus clock\n");
361361
return ret;
362362
}
363363

@@ -1043,7 +1043,13 @@ static int anfc_setup_interface(struct nand_chip *chip, int target,
10431043
DQS_BUFF_SEL_OUT(dqs_mode);
10441044
}
10451045

1046-
anand->clk = ANFC_XLNX_SDR_DFLT_CORE_CLK;
1046+
if (nand_interface_is_sdr(conf)) {
1047+
anand->clk = ANFC_XLNX_SDR_DFLT_CORE_CLK;
1048+
} else {
1049+
/* ONFI timings are defined in picoseconds */
1050+
anand->clk = div_u64((u64)NSEC_PER_SEC * 1000,
1051+
conf->timings.nvddr.tCK_min);
1052+
}
10471053

10481054
/*
10491055
* Due to a hardware bug in the ZynqMP SoC, SDR timing modes 0-1 work

drivers/mtd/nand/raw/cafe_nand.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,10 @@ static int cafe_nand_probe(struct pci_dev *pdev,
679679
pci_set_master(pdev);
680680

681681
cafe = kzalloc(sizeof(*cafe), GFP_KERNEL);
682-
if (!cafe)
683-
return -ENOMEM;
682+
if (!cafe) {
683+
err = -ENOMEM;
684+
goto out_disable_device;
685+
}
684686

685687
mtd = nand_to_mtd(&cafe->nand);
686688
mtd->dev.parent = &pdev->dev;
@@ -801,6 +803,8 @@ static int cafe_nand_probe(struct pci_dev *pdev,
801803
pci_iounmap(pdev, cafe->mmio);
802804
out_free_mtd:
803805
kfree(cafe);
806+
out_disable_device:
807+
pci_disable_device(pdev);
804808
out:
805809
return err;
806810
}
@@ -822,6 +826,7 @@ static void cafe_nand_remove(struct pci_dev *pdev)
822826
pci_iounmap(pdev, cafe->mmio);
823827
dma_free_coherent(&cafe->pdev->dev, 2112, cafe->dmabuf, cafe->dmaaddr);
824828
kfree(cafe);
829+
pci_disable_device(pdev);
825830
}
826831

827832
static const struct pci_device_id cafe_nand_tbl[] = {

drivers/mtd/nand/raw/meson_nand.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,6 @@ static void meson_nfc_nand_chip_cleanup(struct meson_nfc *nfc)
13041304
mtd = nand_to_mtd(&meson_chip->nand);
13051305
WARN_ON(mtd_device_unregister(mtd));
13061306

1307-
meson_nfc_free_buffer(&meson_chip->nand);
13081307
nand_cleanup(&meson_chip->nand);
13091308
list_del(&meson_chip->node);
13101309
}

0 commit comments

Comments
 (0)