You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge tag 'mtd/for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Richard Weinberger:
"MTD core changes:
- Dynamic partition support
- Fix deadlock in sm_ftl
- Various refcount fixes in maps, partitions and parser code
- Integer overflow fixes in mtdchar
- Support for Sercomm partitions
NAND driver changes:
- Clockrate fix for arasan
- Add ATO25D1GA support
- Double free fix for meson driver
- Fix probe/remove methods in cafe NAND
- Support unprotected spare data pages in qcom_nandc
SPI NOR core changes:
- move SECT_4K_PMC flag out of the core as it's a vendor specific
flag
- s/addr_width/addr_nbytes/g: address width means the number of IO
lines used for the address, whereas in the code it is used as the
number of address bytes.
- do not change nor->addr_nbytes at SFDP parsing time. At the SFDP
parsing time we should not change members of struct spi_nor, but
instead fill members of struct spi_nor_flash_parameters which could
later on be used by the callers.
- track flash's internal address mode so that we can use 4B opcodes
together with opcodes that don't have a 4B opcode correspondent.
SPI NOR manufacturer drivers changes:
- esmt: Rename "f25l32qa" flash name to "f25l32qa-2s".
- micron-st: Skip FSR reading if SPI controller does not support it
to allow flashes that support FSR to work even when attached to
such SPI controllers.
- spansion: Add s25hl-t/s25hs-t IDs and fixups"
* tag 'mtd/for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (53 commits)
mtd: core: check partition before dereference
mtd: spi-nor: fix spi_nor_spimem_setup_op() call in spi_nor_erase_{sector,chip}()
mtd: spi-nor: spansion: Add s25hl-t/s25hs-t IDs and fixups
mtd: spi-nor: spansion: Add local function to discover page size
mtd: spi-nor: core: Track flash's internal address mode
mtd: spi-nor: core: Return error code from set_4byte_addr_mode()
mtd: spi-nor: Do not change nor->addr_nbytes at SFDP parsing time
mtd: spi-nor: core: Shrink the storage size of the flash_info's addr_nbytes
mtd: spi-nor: s/addr_width/addr_nbytes
mtd: spi-nor: esmt: Use correct name of f25l32qa
mtd: spi-nor: micron-st: Skip FSR reading if SPI controller does not support it
MAINTAINERS: Use my kernel.org email
mtd: rawnand: arasan: Fix clock rate in NV-DDR
mtd: rawnand: arasan: Update NAND bus clock instead of system clock
mtd: core: introduce of support for dynamic partitions
dt-bindings: mtd: partitions: add additional example for qcom,smem-part
dt-bindings: mtd: partitions: support label/name only partition
mtd: spi-nor: move SECT_4K_PMC special handling
mtd: dataflash: Add SPI ID table
mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path
...
This commit is contained in:
@@ -37,6 +37,4 @@ examples:
|
||||
compatible = "fsl,imx27-nand";
|
||||
reg = <0xd8000000 0x1000>;
|
||||
interrupts = <29>;
|
||||
nand-bus-width = <8>;
|
||||
nand-ecc-mode = "hw";
|
||||
};
|
||||
|
||||
@@ -11,6 +11,17 @@ description: |
|
||||
relative offset and size specified. Depending on partition function extra
|
||||
properties can be used.
|
||||
|
||||
A partition may be dynamically allocated by a specific parser at runtime.
|
||||
In this specific case, a specific suffix is required to the node name.
|
||||
Everything after 'partition-' will be used as the partition name to compare
|
||||
with the one dynamically allocated by the specific parser.
|
||||
If the partition contains invalid char a label can be provided that will
|
||||
be used instead of the node name to make the comparison.
|
||||
This is used to assign an OF node to the dynamiccally allocated partition
|
||||
so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
|
||||
The OF node will be assigned only if the partition label declared match the
|
||||
one assigned by the parser at runtime.
|
||||
|
||||
maintainers:
|
||||
- Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
@@ -41,7 +52,12 @@ properties:
|
||||
immune to paired-pages corruptions
|
||||
type: boolean
|
||||
|
||||
required:
|
||||
- reg
|
||||
if:
|
||||
not:
|
||||
required: [ reg ]
|
||||
then:
|
||||
properties:
|
||||
$nodename:
|
||||
pattern: '^partition-.*$'
|
||||
|
||||
additionalProperties: true
|
||||
|
||||
@@ -19,6 +19,10 @@ properties:
|
||||
compatible:
|
||||
const: qcom,smem-part
|
||||
|
||||
patternProperties:
|
||||
"^partition-[0-9a-z]+$":
|
||||
$ref: partition.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
|
||||
@@ -31,3 +35,26 @@ examples:
|
||||
compatible = "qcom,smem-part";
|
||||
};
|
||||
};
|
||||
|
||||
- |
|
||||
/* Example declaring dynamic partition */
|
||||
flash {
|
||||
partitions {
|
||||
compatible = "qcom,smem-part";
|
||||
|
||||
partition-art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
label = "0:art";
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
macaddr_art_6: macaddr@6 {
|
||||
reg = <0x6 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -102,6 +102,31 @@ allOf:
|
||||
- const: rx
|
||||
- const: cmd
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- qcom,ipq806x-nand
|
||||
|
||||
then:
|
||||
properties:
|
||||
qcom,boot-partitions:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-matrix
|
||||
items:
|
||||
items:
|
||||
- description: offset
|
||||
- description: size
|
||||
description:
|
||||
Boot partition use a different layout where the 4 bytes of spare
|
||||
data are not protected by ECC. Use this to declare these special
|
||||
partitions by defining first the offset and then the size.
|
||||
|
||||
It's in the form of <offset1 size1 offset2 size2 offset3 ...>
|
||||
and should be declared in ascending order.
|
||||
|
||||
Refer to the ipq8064 example on how to use this special binding.
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
@@ -135,6 +160,8 @@ examples:
|
||||
nand-ecc-strength = <4>;
|
||||
nand-bus-width = <8>;
|
||||
|
||||
qcom,boot-partitions = <0x0 0x58a0000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
|
||||
@@ -19130,7 +19130,7 @@ F: drivers/pinctrl/spear/
|
||||
|
||||
SPI NOR SUBSYSTEM
|
||||
M: Tudor Ambarus <tudor.ambarus@microchip.com>
|
||||
M: Pratyush Yadav <p.yadav@ti.com>
|
||||
M: Pratyush Yadav <pratyush@kernel.org>
|
||||
R: Michael Walle <michael@walle.cc>
|
||||
L: linux-mtd@lists.infradead.org
|
||||
S: Maintained
|
||||
|
||||
@@ -112,6 +112,13 @@ static const struct of_device_id dataflash_dt_ids[] = {
|
||||
MODULE_DEVICE_TABLE(of, dataflash_dt_ids);
|
||||
#endif
|
||||
|
||||
static const struct spi_device_id dataflash_spi_ids[] = {
|
||||
{ .name = "at45", },
|
||||
{ .name = "dataflash", },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
|
||||
|
||||
/* ......................................................................... */
|
||||
|
||||
/*
|
||||
@@ -936,6 +943,7 @@ static struct spi_driver dataflash_driver = {
|
||||
|
||||
.probe = dataflash_probe,
|
||||
.remove = dataflash_remove,
|
||||
.id_table = dataflash_spi_ids,
|
||||
|
||||
/* FIXME: investigate suspend and resume... */
|
||||
};
|
||||
|
||||
@@ -270,7 +270,9 @@ static int powernv_flash_release(struct platform_device *pdev)
|
||||
struct powernv_flash *data = dev_get_drvdata(&(pdev->dev));
|
||||
|
||||
/* All resources should be freed automatically */
|
||||
return mtd_device_unregister(&(data->mtd));
|
||||
WARN_ON(mtd_device_unregister(&data->mtd));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id powernv_flash_match[] = {
|
||||
|
||||
@@ -1045,13 +1045,9 @@ static int spear_smi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct spear_smi *dev;
|
||||
struct spear_snor_flash *flash;
|
||||
int ret, i;
|
||||
int i;
|
||||
|
||||
dev = platform_get_drvdata(pdev);
|
||||
if (!dev) {
|
||||
dev_err(&pdev->dev, "dev is null\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* clean up for all nor flash */
|
||||
for (i = 0; i < dev->num_flashes; i++) {
|
||||
@@ -1060,9 +1056,7 @@ static int spear_smi_remove(struct platform_device *pdev)
|
||||
continue;
|
||||
|
||||
/* clean up mtd stuff */
|
||||
ret = mtd_device_unregister(&flash->mtd);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "error removing mtd\n");
|
||||
WARN_ON(mtd_device_unregister(&flash->mtd));
|
||||
}
|
||||
|
||||
clk_disable_unprepare(dev->clk);
|
||||
|
||||
@@ -2084,15 +2084,12 @@ static int stfsm_probe(struct platform_device *pdev)
|
||||
* Configure READ/WRITE/ERASE sequences according to platform and
|
||||
* device flags.
|
||||
*/
|
||||
if (info->config) {
|
||||
if (info->config)
|
||||
ret = info->config(fsm);
|
||||
if (ret)
|
||||
goto err_clk_unprepare;
|
||||
} else {
|
||||
else
|
||||
ret = stfsm_prepare_rwe_seqs_default(fsm);
|
||||
if (ret)
|
||||
goto err_clk_unprepare;
|
||||
}
|
||||
if (ret)
|
||||
goto err_clk_unprepare;
|
||||
|
||||
fsm->mtd.name = info->name;
|
||||
fsm->mtd.dev.parent = &pdev->dev;
|
||||
@@ -2115,10 +2112,12 @@ static int stfsm_probe(struct platform_device *pdev)
|
||||
(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
|
||||
fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
|
||||
|
||||
return mtd_device_register(&fsm->mtd, NULL, 0);
|
||||
|
||||
ret = mtd_device_register(&fsm->mtd, NULL, 0);
|
||||
if (ret) {
|
||||
err_clk_unprepare:
|
||||
clk_disable_unprepare(fsm->clk);
|
||||
clk_disable_unprepare(fsm->clk);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2126,9 +2125,11 @@ static int stfsm_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct stfsm *fsm = platform_get_drvdata(pdev);
|
||||
|
||||
WARN_ON(mtd_device_unregister(&fsm->mtd));
|
||||
|
||||
clk_disable_unprepare(fsm->clk);
|
||||
|
||||
return mtd_device_unregister(&fsm->mtd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
||||
@@ -233,16 +233,16 @@ static int am654_hbmc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct am654_hbmc_priv *priv = platform_get_drvdata(pdev);
|
||||
struct am654_hbmc_device_priv *dev_priv = priv->hbdev.priv;
|
||||
int ret;
|
||||
|
||||
ret = hyperbus_unregister_device(&priv->hbdev);
|
||||
hyperbus_unregister_device(&priv->hbdev);
|
||||
|
||||
if (priv->mux_ctrl)
|
||||
mux_control_deselect(priv->mux_ctrl);
|
||||
|
||||
if (dev_priv->rx_chan)
|
||||
dma_release_channel(dev_priv->rx_chan);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id am654_hbmc_dt_ids[] = {
|
||||
|
||||
@@ -126,16 +126,12 @@ int hyperbus_register_device(struct hyperbus_device *hbdev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(hyperbus_register_device);
|
||||
|
||||
int hyperbus_unregister_device(struct hyperbus_device *hbdev)
|
||||
void hyperbus_unregister_device(struct hyperbus_device *hbdev)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (hbdev && hbdev->mtd) {
|
||||
ret = mtd_device_unregister(hbdev->mtd);
|
||||
WARN_ON(mtd_device_unregister(hbdev->mtd));
|
||||
map_destroy(hbdev->mtd);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(hyperbus_unregister_device);
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
|
||||
|
||||
error = rpcif_hw_init(&hyperbus->rpc, true);
|
||||
if (error)
|
||||
return error;
|
||||
goto out_disable_rpm;
|
||||
|
||||
hyperbus->hbdev.map.size = hyperbus->rpc.size;
|
||||
hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap;
|
||||
@@ -145,19 +145,24 @@ static int rpcif_hb_probe(struct platform_device *pdev)
|
||||
hyperbus->hbdev.np = of_get_next_child(pdev->dev.parent->of_node, NULL);
|
||||
error = hyperbus_register_device(&hyperbus->hbdev);
|
||||
if (error)
|
||||
rpcif_disable_rpm(&hyperbus->rpc);
|
||||
goto out_disable_rpm;
|
||||
|
||||
return 0;
|
||||
|
||||
out_disable_rpm:
|
||||
rpcif_disable_rpm(&hyperbus->rpc);
|
||||
return error;
|
||||
}
|
||||
|
||||
static int rpcif_hb_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct rpcif_hyperbus *hyperbus = platform_get_drvdata(pdev);
|
||||
int error = hyperbus_unregister_device(&hyperbus->hbdev);
|
||||
|
||||
hyperbus_unregister_device(&hyperbus->hbdev);
|
||||
|
||||
rpcif_disable_rpm(&hyperbus->rpc);
|
||||
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver rpcif_platform_driver = {
|
||||
|
||||
@@ -478,7 +478,9 @@ static int lpddr2_nvm_probe(struct platform_device *pdev)
|
||||
*/
|
||||
static int lpddr2_nvm_remove(struct platform_device *pdev)
|
||||
{
|
||||
return mtd_device_unregister(dev_get_drvdata(&pdev->dev));
|
||||
WARN_ON(mtd_device_unregister(dev_get_drvdata(&pdev->dev)));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize platform_driver data structure for lpddr2_nvm */
|
||||
|
||||
@@ -66,18 +66,12 @@ static int physmap_flash_remove(struct platform_device *dev)
|
||||
{
|
||||
struct physmap_flash_info *info;
|
||||
struct physmap_flash_data *physmap_data;
|
||||
int i, err = 0;
|
||||
int i;
|
||||
|
||||
info = platform_get_drvdata(dev);
|
||||
if (!info) {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (info->cmtd) {
|
||||
err = mtd_device_unregister(info->cmtd);
|
||||
if (err)
|
||||
goto out;
|
||||
WARN_ON(mtd_device_unregister(info->cmtd));
|
||||
|
||||
if (info->cmtd != info->mtds[0])
|
||||
mtd_concat_destroy(info->cmtd);
|
||||
@@ -92,10 +86,9 @@ static int physmap_flash_remove(struct platform_device *dev)
|
||||
if (physmap_data && physmap_data->exit)
|
||||
physmap_data->exit(dev);
|
||||
|
||||
out:
|
||||
pm_runtime_put(&dev->dev);
|
||||
pm_runtime_disable(&dev->dev);
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void physmap_set_vpp(struct map_info *map, int state)
|
||||
|
||||
@@ -93,6 +93,7 @@ static int ap_flash_init(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
ebi_base = of_iomap(ebi, 0);
|
||||
of_node_put(ebi);
|
||||
if (!ebi_base)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -207,6 +208,7 @@ int of_flash_probe_versatile(struct platform_device *pdev,
|
||||
|
||||
versatile_flashprot = (enum versatile_flashprot)devid->data;
|
||||
rmap = syscon_node_to_regmap(sysnp);
|
||||
of_node_put(sysnp);
|
||||
if (IS_ERR(rmap))
|
||||
return PTR_ERR(rmap);
|
||||
|
||||
|
||||
@@ -615,21 +615,24 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd,
|
||||
if (!usr_oob)
|
||||
req.ooblen = 0;
|
||||
|
||||
req.len &= 0xffffffff;
|
||||
req.ooblen &= 0xffffffff;
|
||||
|
||||
if (req.start + req.len > mtd->size)
|
||||
return -EINVAL;
|
||||
|
||||
datbuf_len = min_t(size_t, req.len, mtd->erasesize);
|
||||
if (datbuf_len > 0) {
|
||||
datbuf = kmalloc(datbuf_len, GFP_KERNEL);
|
||||
datbuf = kvmalloc(datbuf_len, GFP_KERNEL);
|
||||
if (!datbuf)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
oobbuf_len = min_t(size_t, req.ooblen, mtd->erasesize);
|
||||
if (oobbuf_len > 0) {
|
||||
oobbuf = kmalloc(oobbuf_len, GFP_KERNEL);
|
||||
oobbuf = kvmalloc(oobbuf_len, GFP_KERNEL);
|
||||
if (!oobbuf) {
|
||||
kfree(datbuf);
|
||||
kvfree(datbuf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
@@ -679,8 +682,8 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd,
|
||||
usr_oob += ops.oobretlen;
|
||||
}
|
||||
|
||||
kfree(datbuf);
|
||||
kfree(oobbuf);
|
||||
kvfree(datbuf);
|
||||
kvfree(oobbuf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -546,6 +546,68 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mtd_check_of_node(struct mtd_info *mtd)
|
||||
{
|
||||
struct device_node *partitions, *parent_dn, *mtd_dn = NULL;
|
||||
const char *pname, *prefix = "partition-";
|
||||
int plen, mtd_name_len, offset, prefix_len;
|
||||
struct mtd_info *parent;
|
||||
bool found = false;
|
||||
|
||||
/* Check if MTD already has a device node */
|
||||
if (dev_of_node(&mtd->dev))
|
||||
return;
|
||||
|
||||
/* Check if a partitions node exist */
|
||||
if (!mtd_is_partition(mtd))
|
||||
return;
|
||||
parent = mtd->parent;
|
||||
parent_dn = dev_of_node(&parent->dev);
|
||||
if (!parent_dn)
|
||||
return;
|
||||
|
||||
partitions = of_get_child_by_name(parent_dn, "partitions");
|
||||
if (!partitions)
|
||||
goto exit_parent;
|
||||
|
||||
prefix_len = strlen(prefix);
|
||||
mtd_name_len = strlen(mtd->name);
|
||||
|
||||
/* Search if a partition is defined with the same name */
|
||||
for_each_child_of_node(partitions, mtd_dn) {
|
||||
offset = 0;
|
||||
|
||||
/* Skip partition with no/wrong prefix */
|
||||
if (!of_node_name_prefix(mtd_dn, "partition-"))
|
||||
continue;
|
||||
|
||||
/* Label have priority. Check that first */
|
||||
if (of_property_read_string(mtd_dn, "label", &pname)) {
|
||||
of_property_read_string(mtd_dn, "name", &pname);
|
||||
offset = prefix_len;
|
||||
}
|
||||
|
||||
plen = strlen(pname) - offset;
|
||||
if (plen == mtd_name_len &&
|
||||
!strncmp(mtd->name, pname + offset, plen)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
goto exit_partitions;
|
||||
|
||||
/* Set of_node only for nvmem */
|
||||
if (of_device_is_compatible(mtd_dn, "nvmem-cells"))
|
||||
mtd_set_of_node(mtd, mtd_dn);
|
||||
|
||||
exit_partitions:
|
||||
of_node_put(partitions);
|
||||
exit_parent:
|
||||
of_node_put(parent_dn);
|
||||
}
|
||||
|
||||
/**
|
||||
* add_mtd_device - register an MTD device
|
||||
* @mtd: pointer to new MTD device info structure
|
||||
@@ -658,6 +720,7 @@ int add_mtd_device(struct mtd_info *mtd)
|
||||
mtd->dev.devt = MTD_DEVT(i);
|
||||
dev_set_name(&mtd->dev, "mtd%d", i);
|
||||
dev_set_drvdata(&mtd->dev, mtd);
|
||||
mtd_check_of_node(mtd);
|
||||
of_node_get(mtd_get_of_node(mtd));
|
||||
error = device_register(&mtd->dev);
|
||||
if (error)
|
||||
|
||||
@@ -347,17 +347,17 @@ static int anfc_select_target(struct nand_chip *chip, int target)
|
||||
|
||||
/* Update clock frequency */
|
||||
if (nfc->cur_clk != anand->clk) {
|
||||
clk_disable_unprepare(nfc->controller_clk);
|
||||
ret = clk_set_rate(nfc->controller_clk, anand->clk);
|
||||
clk_disable_unprepare(nfc->bus_clk);
|
||||
ret = clk_set_rate(nfc->bus_clk, anand->clk);
|
||||
if (ret) {
|
||||
dev_err(nfc->dev, "Failed to change clock rate\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(nfc->controller_clk);
|
||||
ret = clk_prepare_enable(nfc->bus_clk);
|
||||
if (ret) {
|
||||
dev_err(nfc->dev,
|
||||
"Failed to re-enable the controller clock\n");
|
||||
"Failed to re-enable the bus clock\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1043,7 +1043,13 @@ static int anfc_setup_interface(struct nand_chip *chip, int target,
|
||||
DQS_BUFF_SEL_OUT(dqs_mode);
|
||||
}
|
||||
|
||||
anand->clk = ANFC_XLNX_SDR_DFLT_CORE_CLK;
|
||||
if (nand_interface_is_sdr(conf)) {
|
||||
anand->clk = ANFC_XLNX_SDR_DFLT_CORE_CLK;
|
||||
} else {
|
||||
/* ONFI timings are defined in picoseconds */
|
||||
anand->clk = div_u64((u64)NSEC_PER_SEC * 1000,
|
||||
conf->timings.nvddr.tCK_min);
|
||||
}
|
||||
|
||||
/*
|
||||
* Due to a hardware bug in the ZynqMP SoC, SDR timing modes 0-1 work
|
||||
|
||||
@@ -2629,7 +2629,9 @@ static int atmel_nand_controller_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct atmel_nand_controller *nc = platform_get_drvdata(pdev);
|
||||
|
||||
return nc->caps->ops->remove(nc);
|
||||
WARN_ON(nc->caps->ops->remove(nc));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __maybe_unused int atmel_nand_controller_resume(struct device *dev)
|
||||
|
||||
@@ -679,8 +679,10 @@ static int cafe_nand_probe(struct pci_dev *pdev,
|
||||
pci_set_master(pdev);
|
||||
|
||||
cafe = kzalloc(sizeof(*cafe), GFP_KERNEL);
|
||||
if (!cafe)
|
||||
return -ENOMEM;
|
||||
if (!cafe) {
|
||||
err = -ENOMEM;
|
||||
goto out_disable_device;
|
||||
}
|
||||
|
||||
mtd = nand_to_mtd(&cafe->nand);
|
||||
mtd->dev.parent = &pdev->dev;
|
||||
@@ -801,6 +803,8 @@ static int cafe_nand_probe(struct pci_dev *pdev,
|
||||
pci_iounmap(pdev, cafe->mmio);
|
||||
out_free_mtd:
|
||||
kfree(cafe);
|
||||
out_disable_device:
|
||||
pci_disable_device(pdev);
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
@@ -822,6 +826,7 @@ static void cafe_nand_remove(struct pci_dev *pdev)
|
||||
pci_iounmap(pdev, cafe->mmio);
|
||||
dma_free_coherent(&cafe->pdev->dev, 2112, cafe->dmabuf, cafe->dmaaddr);
|
||||
kfree(cafe);
|
||||
pci_disable_device(pdev);
|
||||
}
|
||||
|
||||
static const struct pci_device_id cafe_nand_tbl[] = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user