aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/oxnas
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/oxnas')
-rw-r--r--target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch81
-rw-r--r--target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch6
-rw-r--r--target/linux/oxnas/patches-4.4/800-oxnas-ehci.patch2
-rw-r--r--target/linux/oxnas/patches-4.4/999-libata-hacks.patch4
4 files changed, 44 insertions, 49 deletions
diff --git a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
index 9f4b044473..204d6e0bc7 100644
--- a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
+++ b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
@@ -2335,16 +2335,16 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
oob, ops, toread);
oobreadlen -= toread;
}
-@@ -2024,7 +2078,7 @@ static int nand_do_read_oob(struct mtd_i
- struct mtd_oob_ops *ops)
+@@ -2025,7 +2079,7 @@ static int nand_do_read_oob(struct mtd_i
{
+ unsigned int max_bitflips = 0;
int page, realpage, chipnr;
- struct nand_chip *chip = mtd->priv;
+ struct nand_chip *chip = mtd_to_nand(mtd);
struct mtd_ecc_stats stats;
int readlen = ops->ooblen;
int len;
-@@ -2036,10 +2090,7 @@ static int nand_do_read_oob(struct mtd_i
+@@ -2037,10 +2091,7 @@ static int nand_do_read_oob(struct mtd_i
stats = mtd->ecc_stats;
@@ -2356,7 +2356,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (unlikely(ops->ooboffs >= len)) {
pr_debug("%s: attempt to start read outside oob\n",
-@@ -2073,7 +2124,7 @@ static int nand_do_read_oob(struct mtd_i
+@@ -2074,7 +2125,7 @@ static int nand_do_read_oob(struct mtd_i
break;
len = min(len, readlen);
@@ -2365,7 +2365,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (chip->options & NAND_NEED_READRDY) {
/* Apply delay or wait for ready/busy pin */
-@@ -2232,19 +2283,20 @@ static int nand_write_page_swecc(struct
+@@ -2235,19 +2286,20 @@ static int nand_write_page_swecc(struct
const uint8_t *buf, int oob_required,
int page)
{
@@ -2390,7 +2390,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
return chip->ecc.write_page_raw(mtd, chip, buf, 1, page);
}
-@@ -2261,12 +2313,11 @@ static int nand_write_page_hwecc(struct
+@@ -2264,12 +2316,11 @@ static int nand_write_page_hwecc(struct
const uint8_t *buf, int oob_required,
int page)
{
@@ -2404,7 +2404,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
-@@ -2274,8 +2325,10 @@ static int nand_write_page_hwecc(struct
+@@ -2277,8 +2328,10 @@ static int nand_write_page_hwecc(struct
chip->ecc.calculate(mtd, p, &ecc_calc[i]);
}
@@ -2417,7 +2417,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
-@@ -2303,11 +2356,10 @@ static int nand_write_subpage_hwecc(stru
+@@ -2306,11 +2359,10 @@ static int nand_write_subpage_hwecc(stru
int ecc_size = chip->ecc.size;
int ecc_bytes = chip->ecc.bytes;
int ecc_steps = chip->ecc.steps;
@@ -2430,7 +2430,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
for (step = 0; step < ecc_steps; step++) {
/* configure controller for WRITE access */
-@@ -2335,8 +2387,10 @@ static int nand_write_subpage_hwecc(stru
+@@ -2338,8 +2390,10 @@ static int nand_write_subpage_hwecc(stru
/* copy calculated ECC for whole page to chip->buffer->oob */
/* this include masked-value(0xFF) for unwritten subpages */
ecc_calc = chip->buffers->ecccalc;
@@ -2443,7 +2443,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* write OOB buffer to NAND device */
chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
-@@ -2472,7 +2526,8 @@ static int nand_write_page(struct mtd_in
+@@ -2475,7 +2529,8 @@ static int nand_write_page(struct mtd_in
static uint8_t *nand_fill_oob(struct mtd_info *mtd, uint8_t *oob, size_t len,
struct mtd_oob_ops *ops)
{
@@ -2453,7 +2453,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/*
* Initialise to all 0xFF, to avoid the possibility of left over OOB
-@@ -2487,31 +2542,12 @@ static uint8_t *nand_fill_oob(struct mtd
+@@ -2490,31 +2545,12 @@ static uint8_t *nand_fill_oob(struct mtd
memcpy(chip->oob_poi + ops->ooboffs, oob, len);
return oob + len;
@@ -2491,7 +2491,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
default:
BUG();
}
-@@ -2532,12 +2568,11 @@ static int nand_do_write_ops(struct mtd_
+@@ -2535,12 +2571,11 @@ static int nand_do_write_ops(struct mtd_
struct mtd_oob_ops *ops)
{
int chipnr, realpage, page, blockmask, column;
@@ -2506,7 +2506,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
uint8_t *oob = ops->oobbuf;
uint8_t *buf = ops->datbuf;
-@@ -2662,7 +2697,7 @@ err_out:
+@@ -2665,7 +2700,7 @@ err_out:
static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const uint8_t *buf)
{
@@ -2515,7 +2515,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
int chipnr = (int)(to >> chip->chip_shift);
struct mtd_oob_ops ops;
int ret;
-@@ -2725,15 +2760,12 @@ static int nand_do_write_oob(struct mtd_
+@@ -2728,15 +2763,12 @@ static int nand_do_write_oob(struct mtd_
struct mtd_oob_ops *ops)
{
int chipnr, page, status, len;
@@ -2533,7 +2533,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* Do not allow write past end of page */
if ((ops->ooboffs + ops->ooblen) > len) {
-@@ -2850,7 +2882,7 @@ out:
+@@ -2853,7 +2885,7 @@ out:
*/
static int single_erase(struct mtd_info *mtd, int page)
{
@@ -2542,7 +2542,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* Send commands to erase a block */
chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page);
chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1);
-@@ -2882,7 +2914,7 @@ int nand_erase_nand(struct mtd_info *mtd
+@@ -2885,7 +2917,7 @@ int nand_erase_nand(struct mtd_info *mtd
int allowbbt)
{
int page, status, pages_per_block, ret, chipnr;
@@ -2551,7 +2551,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
loff_t len;
pr_debug("%s: start = 0x%012llx, len = %llu\n",
-@@ -2921,7 +2953,7 @@ int nand_erase_nand(struct mtd_info *mtd
+@@ -2924,7 +2956,7 @@ int nand_erase_nand(struct mtd_info *mtd
while (len) {
/* Check if we have a bad block, we do not erase bad blocks! */
if (nand_block_checkbad(mtd, ((loff_t) page) <<
@@ -2560,7 +2560,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
__func__, page);
instr->state = MTD_ERASE_FAILED;
-@@ -3008,7 +3040,20 @@ static void nand_sync(struct mtd_info *m
+@@ -3011,7 +3043,20 @@ static void nand_sync(struct mtd_info *m
*/
static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
{
@@ -2582,7 +2582,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
/**
-@@ -3097,7 +3142,7 @@ static int nand_suspend(struct mtd_info
+@@ -3100,7 +3145,7 @@ static int nand_suspend(struct mtd_info
*/
static void nand_resume(struct mtd_info *mtd)
{
@@ -2591,7 +2591,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (chip->state == FL_PM_SUSPENDED)
nand_release_device(mtd);
-@@ -3269,7 +3314,7 @@ ext_out:
+@@ -3272,7 +3317,7 @@ ext_out:
static int nand_setup_read_retry_micron(struct mtd_info *mtd, int retry_mode)
{
@@ -2600,7 +2600,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
uint8_t feature[ONFI_SUBFEATURE_PARAM_LEN] = {retry_mode};
return chip->onfi_set_features(mtd, chip, ONFI_FEATURE_ADDR_READ_RETRY,
-@@ -3940,10 +3985,13 @@ ident_done:
+@@ -3943,10 +3988,13 @@ ident_done:
return type;
}
@@ -2617,7 +2617,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (of_get_nand_bus_width(dn) == 16)
chip->options |= NAND_BUSWIDTH_16;
-@@ -3952,6 +4000,7 @@ static int nand_dt_init(struct mtd_info
+@@ -3955,6 +4003,7 @@ static int nand_dt_init(struct mtd_info
chip->bbt_options |= NAND_BBT_USE_FLASH;
ecc_mode = of_get_nand_ecc_mode(dn);
@@ -2625,7 +2625,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
ecc_strength = of_get_nand_ecc_strength(dn);
ecc_step = of_get_nand_ecc_step_size(dn);
-@@ -3964,6 +4013,9 @@ static int nand_dt_init(struct mtd_info
+@@ -3967,6 +4016,9 @@ static int nand_dt_init(struct mtd_info
if (ecc_mode >= 0)
chip->ecc.mode = ecc_mode;
@@ -2635,7 +2635,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (ecc_strength >= 0)
chip->ecc.strength = ecc_strength;
-@@ -3987,15 +4039,16 @@ int nand_scan_ident(struct mtd_info *mtd
+@@ -3990,15 +4042,16 @@ int nand_scan_ident(struct mtd_info *mtd
struct nand_flash_dev *table)
{
int i, nand_maf_id, nand_dev_id;
@@ -2658,7 +2658,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (!mtd->name && mtd->dev.parent)
mtd->name = dev_name(mtd->dev.parent);
-@@ -4058,7 +4111,7 @@ EXPORT_SYMBOL(nand_scan_ident);
+@@ -4061,7 +4114,7 @@ EXPORT_SYMBOL(nand_scan_ident);
*/
static bool nand_ecc_strength_good(struct mtd_info *mtd)
{
@@ -2667,7 +2667,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
struct nand_ecc_ctrl *ecc = &chip->ecc;
int corr, ds_corr;
-@@ -4086,10 +4139,10 @@ static bool nand_ecc_strength_good(struc
+@@ -4089,10 +4142,10 @@ static bool nand_ecc_strength_good(struc
*/
int nand_scan_tail(struct mtd_info *mtd)
{
@@ -2680,7 +2680,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* New bad blocks should be marked in OOB, flash-based BBT, or both */
BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) &&
-@@ -4116,19 +4169,15 @@ int nand_scan_tail(struct mtd_info *mtd)
+@@ -4119,19 +4172,15 @@ int nand_scan_tail(struct mtd_info *mtd)
/*
* If no default placement scheme is given, select an appropriate one.
*/
@@ -2703,7 +2703,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
break;
default:
pr_warn("No oob scheme defined for oobsize %d\n",
-@@ -4171,7 +4220,7 @@ int nand_scan_tail(struct mtd_info *mtd)
+@@ -4174,7 +4223,7 @@ int nand_scan_tail(struct mtd_info *mtd)
ecc->write_oob = nand_write_oob_std;
if (!ecc->read_subpage)
ecc->read_subpage = nand_read_subpage;
@@ -2712,7 +2712,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
ecc->write_subpage = nand_write_subpage_hwecc;
case NAND_ECC_HW_SYNDROME:
-@@ -4249,10 +4298,8 @@ int nand_scan_tail(struct mtd_info *mtd)
+@@ -4252,10 +4301,8 @@ int nand_scan_tail(struct mtd_info *mtd)
}
/* See nand_bch_init() for details. */
@@ -2725,7 +2725,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (!ecc->priv) {
pr_warn("BCH ECC initialization failed!\n");
BUG();
-@@ -4283,20 +4330,9 @@ int nand_scan_tail(struct mtd_info *mtd)
+@@ -4286,20 +4333,9 @@ int nand_scan_tail(struct mtd_info *mtd)
if (!ecc->write_oob_raw)
ecc->write_oob_raw = ecc->write_oob;
@@ -2749,7 +2749,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/*
* Set the number of read / write steps for one page depending on ECC
-@@ -4309,6 +4345,21 @@ int nand_scan_tail(struct mtd_info *mtd)
+@@ -4312,6 +4348,21 @@ int nand_scan_tail(struct mtd_info *mtd)
}
ecc->total = ecc->steps * ecc->bytes;
@@ -2771,7 +2771,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/* Allow subpage writes up to ecc.steps. Not possible for MLC flash */
if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) {
switch (ecc->steps) {
-@@ -4365,10 +4416,6 @@ int nand_scan_tail(struct mtd_info *mtd)
+@@ -4368,10 +4419,6 @@ int nand_scan_tail(struct mtd_info *mtd)
mtd->_block_markbad = nand_block_markbad;
mtd->writebufsize = mtd->writesize;
@@ -2782,7 +2782,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/*
* Initialize bitflip_threshold to its default prior scan_bbt() call.
* scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be
-@@ -4424,7 +4471,7 @@ EXPORT_SYMBOL(nand_scan);
+@@ -4427,7 +4474,7 @@ EXPORT_SYMBOL(nand_scan);
*/
void nand_release(struct mtd_info *mtd)
{
@@ -4993,7 +4993,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/*
* NAND Flash Manufacturer ID Codes
*/
-@@ -850,7 +911,6 @@ extern int nand_do_read(struct mtd_info
+@@ -851,7 +912,6 @@ extern int nand_do_read(struct mtd_info
* @chip_delay: R/B delay value in us
* @options: Option flags, e.g. 16bit buswidth
* @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH
@@ -5001,7 +5001,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
* @part_probe_types: NULL-terminated array of probe types
*/
struct platform_nand_chip {
-@@ -858,7 +918,6 @@ struct platform_nand_chip {
+@@ -859,7 +919,6 @@ struct platform_nand_chip {
int chip_offset;
int nr_partitions;
struct mtd_partition *partitions;
@@ -5009,7 +5009,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
int chip_delay;
unsigned int options;
unsigned int bbt_options;
-@@ -908,15 +967,6 @@ struct platform_nand_data {
+@@ -909,15 +968,6 @@ struct platform_nand_data {
struct platform_nand_ctrl ctrl;
};
@@ -5142,7 +5142,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
long long offset, long long length);
--- a/include/linux/mtd/sh_flctl.h
+++ b/include/linux/mtd/sh_flctl.h
-@@ -143,11 +143,11 @@ enum flctl_ecc_res_t {
+@@ -143,7 +143,6 @@ enum flctl_ecc_res_t {
struct dma_chan;
struct sh_flctl {
@@ -5150,12 +5150,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
struct nand_chip chip;
struct platform_device *pdev;
struct dev_pm_qos_request pm_qos;
- void __iomem *reg;
-+ resource_size_t fifo;
-
- uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */
- int read_bytes;
-@@ -186,7 +186,7 @@ struct sh_flctl_platform_data {
+@@ -187,7 +186,7 @@ struct sh_flctl_platform_data {
static inline struct sh_flctl *mtd_to_flctl(struct mtd_info *mtdinfo)
{
diff --git a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch
index aefcfd98a7..8ff28b3bc2 100644
--- a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch
+++ b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch
@@ -39,7 +39,7 @@ Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
info->platform = plat;
--- a/drivers/mtd/nand/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
-@@ -2156,8 +2156,7 @@ int brcmnand_probe(struct platform_devic
+@@ -2149,8 +2149,7 @@ int brcmnand_probe(struct platform_devic
init_completion(&ctrl->done);
init_completion(&ctrl->dma_done);
@@ -87,7 +87,7 @@ Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
}
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -3205,8 +3205,7 @@ static void nand_set_defaults(struct nan
+@@ -3208,8 +3208,7 @@ static void nand_set_defaults(struct nan
if (!chip->controller) {
chip->controller = &chip->hwcontrol;
@@ -135,7 +135,7 @@ Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -1426,8 +1426,7 @@ static int sunxi_nfc_probe(struct platfo
+@@ -1432,8 +1432,7 @@ static int sunxi_nfc_probe(struct platfo
return -ENOMEM;
nfc->dev = dev;
diff --git a/target/linux/oxnas/patches-4.4/800-oxnas-ehci.patch b/target/linux/oxnas/patches-4.4/800-oxnas-ehci.patch
index 5b25afc953..7f26de6b14 100644
--- a/target/linux/oxnas/patches-4.4/800-oxnas-ehci.patch
+++ b/target/linux/oxnas/patches-4.4/800-oxnas-ehci.patch
@@ -1,6 +1,6 @@
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
-@@ -313,6 +313,13 @@ config USB_OCTEON_EHCI
+@@ -315,6 +315,13 @@ config USB_OCTEON_EHCI
USB 2.0 device support. All CN6XXX based chips with USB are
supported.
diff --git a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
index 1f4799dd88..ac278ab234 100644
--- a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
+++ b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
@@ -15,7 +15,7 @@
/* initialize internal qc */
/* XXX: Tag 0 is used for drivers with legacy EH as some
-@@ -4787,6 +4795,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -4788,6 +4796,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
return NULL;
@@ -25,7 +25,7 @@
/* libsas case */
if (ap->flags & ATA_FLAG_SAS_HOST) {
tag = ata_sas_allocate_tag(ap);
-@@ -4832,6 +4843,8 @@ void ata_qc_free(struct ata_queued_cmd *
+@@ -4833,6 +4844,8 @@ void ata_qc_free(struct ata_queued_cmd *
qc->tag = ATA_TAG_POISON;
if (ap->flags & ATA_FLAG_SAS_HOST)
ata_sas_free_tag(tag, ap);