LINUX_VERSION-3.18 = .20
LINUX_VERSION-4.0 = .9
-LINUX_VERSION-4.1 = .4
+LINUX_VERSION-4.1 = .5
LINUX_KERNEL_MD5SUM-3.18.20 = 952c9159acdf4efbc96e08a27109d994
LINUX_KERNEL_MD5SUM-4.0.9 = 40fc5f6e2d718e539b45e6601c71985b
-LINUX_KERNEL_MD5SUM-4.1.4 = 32cb4dd9f14d37bf71bafa6ed368f769
+LINUX_KERNEL_MD5SUM-4.1.5 = f23e1d4ce8f63e46db81d56e36281885
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
#endif
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
-@@ -38,6 +38,9 @@
- #include <asm/traps.h>
+@@ -39,6 +39,9 @@
#include <asm/dma-coherence.h>
+ #include <asm/mips-cm.h>
+/* For enabling BCM4710 cache workarounds */
+int bcm4710 = 0;
/*
* Special Variant of smp_call_function for use by cache functions:
*
-@@ -149,6 +152,9 @@ static void r4k_blast_dcache_user_page_s
+@@ -157,6 +160,9 @@ static void r4k_blast_dcache_user_page_s
{
unsigned long dc_lsize = cpu_dcache_line_size();
if (dc_lsize == 0)
r4k_blast_dcache_user_page = (void *)cache_noop;
else if (dc_lsize == 16)
-@@ -167,6 +173,9 @@ static void r4k_blast_dcache_page_indexe
+@@ -175,6 +181,9 @@ static void r4k_blast_dcache_page_indexe
{
unsigned long dc_lsize = cpu_dcache_line_size();
if (dc_lsize == 0)
r4k_blast_dcache_page_indexed = (void *)cache_noop;
else if (dc_lsize == 16)
-@@ -186,6 +195,9 @@ static void r4k_blast_dcache_setup(void)
+@@ -194,6 +203,9 @@ static void r4k_blast_dcache_setup(void)
{
unsigned long dc_lsize = cpu_dcache_line_size();
if (dc_lsize == 0)
r4k_blast_dcache = (void *)cache_noop;
else if (dc_lsize == 16)
-@@ -785,6 +797,8 @@ static void local_r4k_flush_cache_sigtra
+@@ -793,6 +805,8 @@ static void local_r4k_flush_cache_sigtra
unsigned long addr = (unsigned long) arg;
R4600_HIT_CACHEOP_WAR_IMPL;
if (dc_lsize)
protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
if (!cpu_icache_snoops_remote_store && scache_size)
-@@ -1591,6 +1605,17 @@ static void coherency_setup(void)
+@@ -1599,6 +1613,17 @@ static void coherency_setup(void)
* silly idea of putting something else there ...
*/
switch (current_cpu_type()) {
case CPU_R4000PC:
case CPU_R4000SC:
case CPU_R4000MC:
-@@ -1637,6 +1662,15 @@ void r4k_cache_init(void)
+@@ -1645,6 +1670,15 @@ void r4k_cache_init(void)
extern void build_copy_page(void);
struct cpuinfo_mips *c = ¤t_cpu_data;
probe_pcache();
setup_scache();
-@@ -1706,7 +1740,15 @@ void r4k_cache_init(void)
+@@ -1714,7 +1748,15 @@ void r4k_cache_init(void)
*/
local_r4k___flush_cache_all(NULL);
#endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
-@@ -592,7 +592,7 @@ static inline void local_r4k_flush_cache
+@@ -600,7 +600,7 @@ static inline void local_r4k_flush_cache
*/
map_coherent = (cpu_has_dc_aliases &&
page_mapped(page) && !Page_dcache_dirty(page));
vaddr = kmap_coherent(page, addr);
else
vaddr = kmap_atomic(page);
-@@ -617,7 +617,7 @@ static inline void local_r4k_flush_cache
+@@ -625,7 +625,7 @@ static inline void local_r4k_flush_cache
}
if (vaddr) {
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2702,6 +2702,33 @@ config BOOT_RAW
+@@ -2703,6 +2703,33 @@ config BOOT_RAW
1 file changed, 10 deletions(-)
delete mode 100644 arch/mips/include/asm/mach-bcm63xx/dma-coherence.h
-diff --git a/arch/mips/include/asm/mach-bcm63xx/dma-coherence.h b/arch/mips/include/asm/mach-bcm63xx/dma-coherence.h
-deleted file mode 100644
-index 11d3b57..0000000
--- a/arch/mips/include/asm/mach-bcm63xx/dma-coherence.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <asm/mach-generic/dma-coherence.h>
-
-#endif /* __ASM_MACH_BCM63XX_DMA_COHERENCE_H */
---
-2.1.4
-
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -225,6 +225,46 @@ static struct board_info __initdata board_dsl_2751b_d1 = {
+@@ -225,6 +225,46 @@ static struct board_info __initdata boar
.num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups),
},
};
#endif /* CONFIG_BCM63XX_CPU_6318 */
/*
-@@ -2352,6 +2392,7 @@ static const struct board_info __initconst *bcm963xx_boards[] = {
+@@ -2352,6 +2392,7 @@ static const struct board_info __initcon
&board_96318ref,
&board_96318ref_p300,
&board_dsl_2751b_d1,
#endif
#ifdef CONFIG_BCM63XX_CPU_6328
&board_96328avng,
-@@ -2449,6 +2490,7 @@ static struct of_device_id const bcm963xx_boards_dt[] = {
+@@ -2449,6 +2490,7 @@ static struct of_device_id const bcm963x
{ .compatible = "brcm,bcm96318ref", .data = &board_96318ref, },
{ .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, },
{ .compatible = "d-link,dsl-275xb-d", .data = &board_dsl_2751b_d1, },
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -1570,6 +1570,7 @@ config CPU_CAVIUM_OCTEON
+@@ -1571,6 +1571,7 @@ config CPU_CAVIUM_OCTEON
select CPU_SUPPORTS_HUGEPAGES
select USB_EHCI_BIG_ENDIAN_MMIO
select MIPS_L1_CACHE_SHIFT_7
help
The Cavium Octeon processor is a highly integrated chip containing
many ethernet hardware widgets for networking tasks. The processor
-@@ -1865,6 +1866,9 @@ config MIPS_MALTA_PM
+@@ -1866,6 +1867,9 @@ config MIPS_MALTA_PM
bool
default y
config CEVT_BCM1480
bool
-@@ -2675,6 +2672,18 @@ config USE_OF
+@@ -2676,6 +2673,18 @@ config USE_OF
config BUILTIN_DTB
bool
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2667,6 +2667,20 @@ config MIPS_O32_FP64_SUPPORT
+@@ -2668,6 +2668,20 @@ config MIPS_O32_FP64_SUPPORT
If unsure, say N.
uart->tx_loadsz = up->tx_loadsz;
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
-@@ -2176,6 +2176,7 @@ uart_report_port(struct uart_driver *drv
+@@ -2177,6 +2177,7 @@ uart_report_port(struct uart_driver *drv
snprintf(address, sizeof(address),
"I/O 0x%lx offset 0x%x", port->iobase, port->hub6);
break;
case UPIO_MEM:
case UPIO_MEM32:
case UPIO_MEM32BE:
-@@ -2823,6 +2824,7 @@ int uart_match_port(struct uart_port *po
+@@ -2824,6 +2825,7 @@ int uart_match_port(struct uart_port *po
case UPIO_HUB6:
return (port1->iobase == port2->iobase) &&
(port1->hub6 == port2->hub6);
include/linux/mfd/axp20x.h | 86 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 184 insertions(+)
-diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
-index d18029b..cfbb7d7 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -32,6 +32,7 @@
"AXP288",
};
-@@ -54,6 +55,25 @@ static const struct regmap_access_table axp20x_volatile_table = {
+@@ -54,6 +55,25 @@ static const struct regmap_access_table
.n_yes_ranges = ARRAY_SIZE(axp20x_volatile_ranges),
};
static const struct regmap_range axp288_writeable_ranges[] = {
regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),
regmap_reg_range(AXP20X_DCDC_MODE, AXP288_FG_TUNE5),
-@@ -87,6 +107,20 @@ static struct resource axp20x_pek_resources[] = {
+@@ -87,6 +107,20 @@ static struct resource axp20x_pek_resour
},
};
static struct resource axp288_fuel_gauge_resources[] = {
{
.start = AXP288_IRQ_QWBTU,
-@@ -129,6 +163,15 @@ static const struct regmap_config axp20x_regmap_config = {
+@@ -129,6 +163,15 @@ static const struct regmap_config axp20x
.cache_type = REGCACHE_RBTREE,
};
static const struct regmap_config axp288_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
-@@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_regmap_irqs[] = {
+@@ -181,6 +224,34 @@ static const struct regmap_irq axp20x_re
INIT_REGMAP_IRQ(AXP20X, GPIO0_INPUT, 4, 0),
};
/* some IRQs are compatible with axp20x models */
static const struct regmap_irq axp288_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP288, VBUS_FALL, 0, 2),
-@@ -224,6 +295,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
+@@ -224,6 +295,7 @@ static const struct regmap_irq axp288_re
static const struct of_device_id axp20x_of_match[] = {
{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
{ },
};
MODULE_DEVICE_TABLE(of, axp20x_of_match);
-@@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
+@@ -258,6 +330,18 @@ static const struct regmap_irq_chip axp2
};
static const struct regmap_irq_chip axp288_regmap_irq_chip = {
.name = "axp288_irq_chip",
.status_base = AXP20X_IRQ1_STATE,
-@@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] = {
+@@ -281,6 +365,14 @@ static struct mfd_cell axp20x_cells[] =
},
};
static struct resource axp288_adc_resources[] = {
{
.name = "GPADC",
-@@ -426,6 +518,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
+@@ -426,6 +518,12 @@ static int axp20x_match_device(struct ax
axp20x->regmap_cfg = &axp20x_regmap_config;
axp20x->regmap_irq_chip = &axp20x_regmap_irq_chip;
break;
case AXP288_ID:
axp20x->cells = axp288_cells;
axp20x->nr_cells = ARRAY_SIZE(axp288_cells);
-diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
-index dfabd6d..95568eb 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -14,6 +14,7 @@
drivers/regulator/axp20x-regulator.c | 143 +++++++++++++++++++++++------------
1 file changed, 94 insertions(+), 49 deletions(-)
-diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
-index e4331f5..50ae0b5 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -32,15 +32,15 @@
.n_voltages = ARRAY_SIZE(_table), \
.owner = THIS_MODULE, \
.vsel_reg = (_vreg), \
-@@ -136,37 +136,57 @@ static struct regulator_ops axp20x_ops = {
+@@ -136,37 +136,57 @@ static struct regulator_ops axp20x_ops =
};
static const struct regulator_desc axp20x_regulators[] = {
{
struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
+ u32 min, max, def, step;
-+
+
+- if (dcdcfreq < 750) {
+- dcdcfreq = 750;
+- dev_warn(&pdev->dev, "DCDC frequency too low. Set to 750kHz\n");
+ switch (axp20x->variant) {
+ case AXP202_ID:
+ case AXP209_ID:
+ dev_err(&pdev->dev,
+ "Setting DCDC frequency for unsupported AXP variant\n");
+ return -EINVAL;
-+ }
-+
+ }
+
+- if (dcdcfreq > 1875) {
+- dcdcfreq = 1875;
+- dev_warn(&pdev->dev, "DCDC frequency too high. Set to 1875kHz\n");
+ if (dcdcfreq == 0)
+ dcdcfreq = def;
-
-- if (dcdcfreq < 750) {
-- dcdcfreq = 750;
-- dev_warn(&pdev->dev, "DCDC frequency too low. Set to 750kHz\n");
++
+ if (dcdcfreq < min) {
+ dcdcfreq = min;
+ dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n",
+ min);
}
-- if (dcdcfreq > 1875) {
-- dcdcfreq = 1875;
-- dev_warn(&pdev->dev, "DCDC frequency too high. Set to 1875kHz\n");
+- dcdcfreq = (dcdcfreq - 750) / 75;
+ if (dcdcfreq > max) {
+ dcdcfreq = max;
+ dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n",
+ max);
- }
-
-- dcdcfreq = (dcdcfreq - 750) / 75;
++ }
++
+ dcdcfreq = (dcdcfreq - min) / step;
return regmap_update_bits(axp20x->regmap, AXP20X_DCDC_FREQ,
AXP20X_FREQ_DCDC_MASK, dcdcfreq);
-@@ -176,7 +196,7 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
+@@ -176,7 +196,7 @@ static int axp20x_regulator_parse_dt(str
{
struct device_node *np, *regulators;
int ret;
np = of_node_get(pdev->dev.parent->of_node);
if (!np)
-@@ -186,7 +206,6 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
+@@ -186,7 +206,6 @@ static int axp20x_regulator_parse_dt(str
if (!regulators) {
dev_warn(&pdev->dev, "regulators node not found\n");
} else {
of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq);
ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
if (ret < 0) {
-@@ -202,15 +221,27 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
+@@ -202,15 +221,27 @@ static int axp20x_regulator_parse_dt(str
static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode)
{
+ unsigned int mask;
- if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3))
-- return -EINVAL;
+ switch (axp20x->variant) {
+ case AXP202_ID:
+ case AXP209_ID:
+ mask = AXP20X_WORKMODE_DCDC2_MASK;
+ if (id == AXP20X_DCDC3)
+ mask = AXP20X_WORKMODE_DCDC3_MASK;
-
-- if (id == AXP20X_DCDC3)
-- mask = AXP20X_WORKMODE_DCDC3_MASK;
++
+ workmode <<= ffs(mask) - 1;
+ break;
-
-- workmode <<= ffs(mask) - 1;
++
+ default:
+ /* should not happen */
+ WARN_ON(1);
-+ return -EINVAL;
+ return -EINVAL;
+-
+- if (id == AXP20X_DCDC3)
+- mask = AXP20X_WORKMODE_DCDC3_MASK;
+-
+- workmode <<= ffs(mask) - 1;
+ }
return regmap_update_bits(rdev->regmap, AXP20X_DCDC_MODE, mask, workmode);
}
-@@ -219,22 +250,36 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
+@@ -219,22 +250,36 @@ static int axp20x_regulator_probe(struct
{
struct regulator_dev *rdev;
struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
return PTR_ERR(rdev);
}
-@@ -245,7 +290,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
+@@ -245,7 +290,7 @@ static int axp20x_regulator_probe(struct
if (!ret) {
if (axp20x_set_dcdc_workmode(rdev, i, workmode))
dev_err(&pdev->dev, "Failed to set workmode on %s\n",
drivers/regulator/axp20x-regulator.c | 96 ++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
-diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
-index 50ae0b5..6468291 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -27,8 +27,12 @@
#define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt) \
[_family##_##_id] = { \
.name = #_id, \
-@@ -135,6 +159,14 @@ static struct regulator_ops axp20x_ops = {
+@@ -135,6 +159,14 @@ static struct regulator_ops axp20x_ops =
.is_enabled = regulator_is_enabled_regmap,
};
static const struct regulator_desc axp20x_regulators[] = {
AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
-@@ -152,6 +184,52 @@ static const struct regulator_desc axp20x_regulators[] = {
+@@ -152,6 +184,52 @@ static const struct regulator_desc axp20
AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
};
static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
{
struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
-@@ -165,6 +243,12 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
+@@ -165,6 +243,12 @@ static int axp20x_set_dcdc_freq(struct p
def = 1500;
step = 75;
break;
default:
dev_err(&pdev->dev,
"Setting DCDC frequency for unsupported AXP variant\n");
-@@ -237,6 +321,14 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
+@@ -237,6 +321,14 @@ static int axp20x_set_dcdc_workmode(stru
workmode <<= ffs(mask) - 1;
break;
default:
/* should not happen */
WARN_ON(1);
-@@ -265,6 +357,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
+@@ -265,6 +357,10 @@ static int axp20x_regulator_probe(struct
regulators = axp20x_regulators;
nregulators = AXP20X_REG_ID_MAX;
break;
include/linux/mfd/axp20x.h | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
-diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
-index b369cfc..8bd3283 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
-@@ -61,10 +61,16 @@ static const struct regmap_access_table axp152_volatile_table = {
+@@ -39,10 +39,16 @@ static const char * const axp20x_model_n
static const struct regmap_range axp20x_writeable_ranges[] = {
regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
regmap_reg_range(AXP20X_DCDC_MODE, AXP20X_FG_RES),
};
static const struct regmap_access_table axp20x_writeable_table = {
-@@ -195,7 +201,7 @@ static const struct regmap_config axp20x_regmap_config = {
+@@ -159,7 +165,7 @@ static const struct regmap_config axp20x
.val_bits = 8,
.wr_table = &axp20x_writeable_table,
.volatile_table = &axp20x_volatile_table,
.cache_type = REGCACHE_RBTREE,
};
-diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
-index 52203d5..cc8ad1e 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
-@@ -190,6 +190,12 @@ enum {
+@@ -151,6 +151,12 @@ enum {
#define AXP20X_CC_CTRL 0xb8
#define AXP20X_FG_RES 0xb9
drivers/mfd/axp20x.c | 2 ++
1 file changed, 2 insertions(+)
-diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
-index cfbb7d7..6df9155 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
-@@ -370,6 +370,8 @@ static struct mfd_cell axp22x_cells[] = {
+@@ -376,6 +376,8 @@ static struct mfd_cell axp22x_cells[] =
.name = "axp20x-pek",
.num_resources = ARRAY_SIZE(axp22x_pek_resources),
.resources = axp22x_pek_resources,
include/linux/mfd/axp20x.h | 61 +++++++++++++++++++++++++++++++++-
2 files changed, 143 insertions(+), 1 deletion(-)
-diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
-index 8c2c3c4..b369cfc 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -30,12 +30,34 @@
static const struct regmap_range axp20x_writeable_ranges[] = {
regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
regmap_reg_range(AXP20X_DCDC_MODE, AXP20X_FG_RES),
-@@ -93,6 +115,11 @@ static const struct regmap_access_table axp288_volatile_table = {
+@@ -99,6 +121,11 @@ static const struct regmap_access_table
.n_yes_ranges = ARRAY_SIZE(axp288_volatile_ranges),
};
static struct resource axp20x_pek_resources[] = {
{
.name = "PEK_DBR",
-@@ -154,6 +181,15 @@ static struct resource axp288_fuel_gauge_resources[] = {
+@@ -160,6 +187,15 @@ static struct resource axp288_fuel_gauge
},
};
static const struct regmap_config axp20x_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
-@@ -184,6 +220,26 @@ static const struct regmap_config axp288_regmap_config = {
+@@ -190,6 +226,26 @@ static const struct regmap_config axp288
#define INIT_REGMAP_IRQ(_variant, _irq, _off, _mask) \
[_variant##_IRQ_##_irq] = { .reg_offset = (_off), .mask = BIT(_mask) }
static const struct regmap_irq axp20x_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP20X, ACIN_OVER_V, 0, 7),
INIT_REGMAP_IRQ(AXP20X, ACIN_PLUGIN, 0, 6),
-@@ -293,6 +349,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
+@@ -299,6 +355,7 @@ static const struct regmap_irq axp288_re
};
static const struct of_device_id axp20x_of_match[] = {
{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
-@@ -317,6 +374,18 @@ static const struct acpi_device_id axp20x_acpi_match[] = {
+@@ -323,6 +380,18 @@ static const struct acpi_device_id axp20
};
MODULE_DEVICE_TABLE(acpi, axp20x_acpi_match);
static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
.name = "axp20x_irq_chip",
.status_base = AXP20X_IRQ1_STATE,
-@@ -375,6 +444,14 @@ static struct mfd_cell axp22x_cells[] = {
+@@ -381,6 +450,14 @@ static struct mfd_cell axp22x_cells[] =
},
};
static struct resource axp288_adc_resources[] = {
{
.name = "GPADC",
-@@ -513,6 +590,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
+@@ -519,6 +596,12 @@ static int axp20x_match_device(struct ax
}
switch (axp20x->variant) {
case AXP202_ID:
case AXP209_ID:
axp20x->nr_cells = ARRAY_SIZE(axp20x_cells);
-diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
-index c2aa853..52203d5 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -12,7 +12,8 @@
#define AXP20X_GPIO0_CTRL 0x90
#define AXP20X_LDO5_V_OUT 0x91
#define AXP20X_GPIO1_CTRL 0x92
-@@ -218,6 +257,26 @@ enum {
+@@ -224,6 +263,26 @@ enum {
/* IRQs */
enum {
drivers/mtd/nand/nand_base.c | 91 +++++++++++++++++++++++++++-----------------
1 file changed, 56 insertions(+), 35 deletions(-)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index c2e1232..f580ed1 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -3892,42 +3892,15 @@ static bool nand_ecc_strength_good(struct mtd_info *mtd)
+@@ -3892,42 +3892,15 @@ static bool nand_ecc_strength_good(struc
return corr >= ds_corr && ecc->strength >= chip->ecc_strength_ds;
}
- struct nand_chip *chip = mtd->priv;
- struct nand_ecc_ctrl *ecc = &chip->ecc;
- struct nand_buffers *nbuf;
--
+
- /* New bad blocks should be marked in OOB, flash-based BBT, or both */
- BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) &&
- !(chip->bbt_options & NAND_BBT_USE_FLASH));
- nbuf->ecccalc = (uint8_t *)(nbuf + 1);
- nbuf->ecccode = nbuf->ecccalc + mtd->oobsize;
- nbuf->databuf = nbuf->ecccode + mtd->oobsize;
-
+-
- chip->buffers = nbuf;
- } else {
- if (!chip->buffers)
include/linux/mtd/nand.h | 38 +++
6 files changed, 635 insertions(+), 141 deletions(-)
-diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
-index 5897d8d..8242470 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -22,6 +22,10 @@ menuconfig MTD_NAND
config MTD_NAND_BCH
tristate
select BCH
-diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
-index 582bbd05..fcbe032 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
-@@ -53,4 +53,6 @@ obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) += bcm47xxnflash/
+@@ -53,4 +53,6 @@ obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH) +=
obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o
obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o
+obj-$(CONFIG_MTD_OF_NAND_PARTS) += ofnandpart.o
+
nand-objs := nand_base.o nand_bbt.o nand_timings.o
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index f580ed1..a30b67f 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -1134,26 +1134,26 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd,
+@@ -1134,26 +1134,26 @@ static int nand_read_page_raw_syndrome(s
struct nand_chip *chip, uint8_t *buf,
int oob_required, int page)
{
}
}
-@@ -1175,30 +1175,31 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd,
+@@ -1175,30 +1175,31 @@ static int nand_read_page_raw_syndrome(s
static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
if (stat < 0) {
mtd->ecc_stats.failed++;
} else {
-@@ -1223,7 +1224,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1223,7 +1224,7 @@ static int nand_read_subpage(struct mtd_
int page)
{
int start_step, end_step, num_steps;
uint8_t *p;
int data_col_addr, i, gaps = 0;
int datafrag_len, eccfrag_len, aligned_len, aligned_pos;
-@@ -1232,16 +1233,16 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1232,16 +1233,16 @@ static int nand_read_subpage(struct mtd_
unsigned int max_bitflips = 0;
/* Column address within the page aligned to ECC size (256bytes) */
/* If we read not a page aligned data */
if (data_col_addr != 0)
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1);
-@@ -1250,8 +1251,9 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1250,8 +1251,9 @@ static int nand_read_subpage(struct mtd_
chip->read_buf(mtd, p, datafrag_len);
/* Calculate ECC */
/*
* The performance is faster if we position offsets according to
-@@ -1275,7 +1277,8 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1275,7 +1277,8 @@ static int nand_read_subpage(struct mtd_
aligned_len = eccfrag_len;
if (eccpos[index] & (busw - 1))
aligned_len++;
aligned_len++;
chip->cmdfunc(mtd, NAND_CMD_RNDOUT,
-@@ -1287,11 +1290,13 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1287,11 +1290,13 @@ static int nand_read_subpage(struct mtd_
chip->buffers->ecccode[i] = chip->oob_poi[eccpos[i + index]];
p = bufpoi + data_col_addr;
if (stat < 0) {
mtd->ecc_stats.failed++;
} else {
-@@ -1315,32 +1320,33 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1315,32 +1320,33 @@ static int nand_read_subpage(struct mtd_
static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
if (stat < 0) {
mtd->ecc_stats.failed++;
} else {
-@@ -1368,12 +1374,12 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1368,12 +1374,12 @@ static int nand_read_page_hwecc(struct m
static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
struct nand_chip *chip, uint8_t *buf, int oob_required, int page)
{
uint8_t *ecc_calc = chip->buffers->ecccalc;
unsigned int max_bitflips = 0;
-@@ -1382,17 +1388,17 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
+@@ -1382,17 +1388,17 @@ static int nand_read_page_hwecc_oob_firs
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
if (stat < 0) {
mtd->ecc_stats.failed++;
} else {
-@@ -1417,9 +1423,9 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
+@@ -1417,9 +1423,9 @@ static int nand_read_page_hwecc_oob_firs
static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
uint8_t *p = buf;
uint8_t *oob = chip->oob_poi;
unsigned int max_bitflips = 0;
-@@ -1427,17 +1433,17 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1427,17 +1433,17 @@ static int nand_read_page_syndrome(struc
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
int stat;
if (stat < 0) {
mtd->ecc_stats.failed++;
-@@ -1448,9 +1454,9 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1448,9 +1454,9 @@ static int nand_read_page_syndrome(struc
oob += eccbytes;
}
}
-@@ -1480,7 +1486,7 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
+@@ -1480,7 +1486,7 @@ static uint8_t *nand_transfer_oob(struct
return oob + len;
case MTD_OPS_AUTO_OOB: {
uint32_t boffs = 0, roffs = ops->ooboffs;
size_t bytes = 0;
-@@ -1600,17 +1606,21 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
+@@ -1600,17 +1606,21 @@ read_retry:
* the read methods return max bitflips per ecc step.
*/
if (unlikely(ops->mode == MTD_OPS_RAW))
if (ret < 0) {
if (use_bufpoi)
/* Invalidate page cache */
-@@ -1746,6 +1756,39 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
+@@ -1746,6 +1756,39 @@ static int nand_read(struct mtd_info *mt
}
/**
* nand_read_oob_std - [REPLACEABLE] the most common OOB data read function
* @mtd: mtd info structure
* @chip: nand chip info structure
-@@ -1770,13 +1813,14 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1770,13 +1813,14 @@ static int nand_read_oob_syndrome(struct
int page)
{
int length = mtd->oobsize;
if (sndrnd) {
pos = eccsize + i * (eccsize + chunk);
if (mtd->writesize > 512)
-@@ -1829,9 +1873,10 @@ static int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1829,9 +1873,10 @@ static int nand_write_oob_std(struct mtd
static int nand_write_oob_syndrome(struct mtd_info *mtd,
struct nand_chip *chip, int page)
{
const uint8_t *bufpoi = chip->oob_poi;
/*
-@@ -1839,7 +1884,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,
+@@ -1839,7 +1884,7 @@ static int nand_write_oob_syndrome(struc
* or
* data-pad-ecc-pad-data-pad .... ecc-pad-oob
*/
pos = steps * (eccsize + chunk);
steps = 0;
} else
-@@ -1903,7 +1948,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -1903,7 +1948,7 @@ static int nand_do_read_oob(struct mtd_i
stats = mtd->ecc_stats;
if (ops->mode == MTD_OPS_AUTO_OOB)
else
len = mtd->oobsize;
-@@ -1931,9 +1976,9 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -1931,9 +1976,9 @@ static int nand_do_read_oob(struct mtd_i
while (1) {
if (ops->mode == MTD_OPS_RAW)
if (ret < 0)
break;
-@@ -2021,6 +2066,56 @@ static int nand_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -2021,6 +2066,56 @@ out:
return ret;
}
/**
* nand_write_page_raw - [INTERN] raw page write function
-@@ -2054,26 +2149,26 @@ static int nand_write_page_raw_syndrome(struct mtd_info *mtd,
+@@ -2054,26 +2149,26 @@ static int nand_write_page_raw_syndrome(
struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
}
}
-@@ -2093,21 +2188,21 @@ static int nand_write_page_raw_syndrome(struct mtd_info *mtd,
+@@ -2093,21 +2188,21 @@ static int nand_write_page_raw_syndrome(
static int nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
}
/**
-@@ -2120,20 +2215,20 @@ static int nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -2120,20 +2215,20 @@ static int nand_write_page_swecc(struct
static int nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
chip->oob_poi[eccpos[i]] = ecc_calc[i];
chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
-@@ -2158,10 +2253,10 @@ static int nand_write_subpage_hwecc(struct mtd_info *mtd,
+@@ -2158,10 +2253,10 @@ static int nand_write_subpage_hwecc(stru
{
uint8_t *oob_buf = chip->oob_poi;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint32_t start_step = offset / ecc_size;
uint32_t end_step = (offset + data_len - 1) / ecc_size;
int oob_bytes = mtd->oobsize / ecc_steps;
-@@ -2169,7 +2264,7 @@ static int nand_write_subpage_hwecc(struct mtd_info *mtd,
+@@ -2169,7 +2264,7 @@ static int nand_write_subpage_hwecc(stru
for (step = 0; step < ecc_steps; step++) {
/* configure controller for WRITE access */
/* write data (untouched subpages already masked by 0xFF) */
chip->write_buf(mtd, buf, ecc_size);
-@@ -2178,7 +2273,7 @@ static int nand_write_subpage_hwecc(struct mtd_info *mtd,
+@@ -2178,7 +2273,7 @@ static int nand_write_subpage_hwecc(stru
if ((step < start_step) || (step > end_step))
memset(ecc_calc, 0xff, ecc_bytes);
else
/* mask OOB of un-touched subpages by padding 0xFF */
/* if oob_required, preserve OOB metadata of written subpage */
-@@ -2193,7 +2288,7 @@ static int nand_write_subpage_hwecc(struct mtd_info *mtd,
+@@ -2193,7 +2288,7 @@ 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;
chip->oob_poi[eccpos[i]] = ecc_calc[i];
/* write OOB buffer to NAND device */
-@@ -2217,29 +2312,29 @@ static int nand_write_page_syndrome(struct mtd_info *mtd,
+@@ -2217,29 +2312,29 @@ static int nand_write_page_syndrome(stru
struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
}
}
-@@ -2270,7 +2365,7 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -2270,7 +2365,7 @@ static int nand_write_page(struct mtd_in
int status, subpage;
if (!(chip->options & NAND_NO_SUBPAGE_WRITE) &&
subpage = offset || (data_len < mtd->writesize);
else
subpage = 0;
-@@ -2278,13 +2373,15 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -2278,13 +2373,15 @@ static int nand_write_page(struct mtd_in
chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);
if (unlikely(raw))
if (status < 0)
return status;
-@@ -2343,7 +2440,7 @@ static uint8_t *nand_fill_oob(struct mtd_info *mtd, uint8_t *oob, size_t len,
+@@ -2343,7 +2440,7 @@ static uint8_t *nand_fill_oob(struct mtd
return oob + len;
case MTD_OPS_AUTO_OOB: {
uint32_t boffs = 0, woffs = ops->ooboffs;
size_t bytes = 0;
-@@ -2539,6 +2636,46 @@ static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
+@@ -2539,6 +2636,46 @@ static int panic_nand_write(struct mtd_i
}
/**
* nand_write - [MTD Interface] NAND write with ECC
* @mtd: MTD device structure
* @to: offset to write to
-@@ -2566,6 +2703,39 @@ static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
+@@ -2566,6 +2703,39 @@ static int nand_write(struct mtd_info *m
}
/**
* nand_do_write_oob - [MTD Interface] NAND write out-of-band
* @mtd: MTD device structure
* @to: offset to write to
-@@ -2583,7 +2753,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
+@@ -2583,7 +2753,7 @@ static int nand_do_write_oob(struct mtd_
__func__, (unsigned int)to, (int)ops->ooblen);
if (ops->mode == MTD_OPS_AUTO_OOB)
else
len = mtd->oobsize;
-@@ -2637,9 +2807,11 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
+@@ -2637,9 +2807,11 @@ static int nand_do_write_oob(struct mtd_
nand_fill_oob(mtd, ops->oobbuf, ops->ooblen, ops);
if (ops->mode == MTD_OPS_RAW)
chip->select_chip(mtd, -1);
-@@ -2694,6 +2866,54 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to,
+@@ -2694,6 +2866,54 @@ out:
}
/**
* single_erase - [GENERIC] NAND standard block erase command function
* @mtd: MTD device structure
* @page: the page address of the block which will be erased
-@@ -2723,6 +2943,29 @@ static int nand_erase(struct mtd_info *mtd, struct erase_info *instr)
+@@ -2723,6 +2943,29 @@ static int nand_erase(struct mtd_info *m
}
/**
* nand_erase_nand - [INTERN] erase block(s)
* @mtd: MTD device structure
* @instr: erase instruction
-@@ -2864,6 +3107,18 @@ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
+@@ -2864,6 +3107,18 @@ static int nand_block_isbad(struct mtd_i
}
/**
* nand_block_markbad - [MTD Interface] Mark block at the given offset as bad
* @mtd: MTD device structure
* @ofs: offset relative to mtd start
-@@ -2884,6 +3139,33 @@ static int nand_block_markbad(struct mtd_info *mtd, loff_t ofs)
+@@ -2884,6 +3139,33 @@ static int nand_block_markbad(struct mtd
}
/**
* nand_onfi_set_features- [REPLACEABLE] set features for ONFI nand
* @mtd: MTD device structure
* @chip: nand chip info structure
-@@ -4099,6 +4381,169 @@ static int nand_ecc_ctrl_init(struct mtd_info *mtd, struct nand_ecc_ctrl *ecc)
+@@ -4099,6 +4381,169 @@ static int nand_ecc_ctrl_init(struct mtd
}
/**
/* 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) {
-diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/nand/nand_bch.c
-index 3803e0b..b82b976 100644
--- a/drivers/mtd/nand/nand_bch.c
+++ b/drivers/mtd/nand/nand_bch.c
-@@ -53,14 +53,14 @@ int nand_bch_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf,
+@@ -53,14 +53,14 @@ int nand_bch_calculate_ecc(struct mtd_in
unsigned char *code)
{
const struct nand_chip *chip = mtd->priv;
code[i] ^= nbc->eccmask[i];
return 0;
-@@ -80,15 +80,15 @@ int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf,
+@@ -80,15 +80,15 @@ int nand_bch_correct_data(struct mtd_inf
unsigned char *read_ecc, unsigned char *calc_ecc)
{
const struct nand_chip *chip = mtd->priv;
/* error is located in data, correct it */
buf[errloc[i] >> 3] ^= (1 << (errloc[i] & 7));
/* else error in ecc, no action needed */
-diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
-index 97c4c02..f35c418 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
-@@ -424,7 +424,7 @@ int nand_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf,
+@@ -424,7 +424,7 @@ int nand_calculate_ecc(struct mtd_info *
unsigned char *code)
{
__nand_calculate_ecc(buf,
return 0;
}
-@@ -524,7 +524,7 @@ int nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
+@@ -524,7 +524,7 @@ int nand_correct_data(struct mtd_info *m
unsigned char *read_ecc, unsigned char *calc_ecc)
{
return __nand_correct_data(buf, read_ecc, calc_ecc,
}
EXPORT_SYMBOL(nand_correct_data);
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 3d4ea7e..510e09b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -708,6 +708,7 @@ struct nand_chip {
2 files changed, 121 insertions(+)
create mode 100644 drivers/mtd/nand/ofnandpart.c
-diff --git a/drivers/mtd/nand/ofnandpart.c b/drivers/mtd/nand/ofnandpart.c
-new file mode 100644
-index 0000000..293daee
--- /dev/null
+++ b/drivers/mtd/nand/ofnandpart.c
@@ -0,0 +1,104 @@
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Parser for NAND flash partitioning information in device tree");
+MODULE_AUTHOR("Boris BREZILLON");
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 510e09b..5616f51 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
-@@ -1013,6 +1013,23 @@ static inline int jedec_feature(struct nand_chip *chip)
+@@ -1014,6 +1014,23 @@ static inline int jedec_feature(struct n
: 0;
}
include/linux/mtd/nand.h | 21 ++++++
2 files changed, 175 insertions(+)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index a30b67f..8a5d12e 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -1102,6 +1102,138 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
+@@ -1102,6 +1102,138 @@ out:
EXPORT_SYMBOL(nand_lock);
/**
* nand_read_page_raw - [INTERN] read raw page data without ecc
* @mtd: mtd info structure
* @chip: nand chip info structure
-@@ -2539,6 +2671,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
+@@ -2539,6 +2671,7 @@ static int nand_do_write_ops(struct mtd_
uint8_t *wbuf = buf;
int use_bufpoi;
int part_pagewr = (column || writelen < (mtd->writesize - 1));
if (part_pagewr)
use_bufpoi = 1;
-@@ -2574,6 +2707,14 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
+@@ -2574,6 +2707,14 @@ static int nand_do_write_ops(struct mtd_
if (ret)
break;
writelen -= bytes;
if (!writelen)
break;
-@@ -2979,6 +3120,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
+@@ -2979,6 +3120,7 @@ int nand_erase_nand(struct mtd_info *mtd
int page, status, pages_per_block, ret, chipnr;
struct nand_chip *chip = mtd->priv;
loff_t len;
pr_debug("%s: start = 0x%012llx, len = %llu\n",
__func__, (unsigned long long)instr->addr,
-@@ -3051,6 +3193,18 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
+@@ -3051,6 +3193,18 @@ int nand_erase_nand(struct mtd_info *mtd
goto erase_exit;
}
/* Increment page address and decrement length */
len -= (1ULL << chip->phys_erase_shift);
page += pages_per_block;
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 5616f51..4f7ca8d 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -521,6 +521,24 @@ struct nand_ecc_ctrl {
include/linux/mtd/nand.h | 98 +++++++++++++++
2 files changed, 321 insertions(+), 55 deletions(-)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index 8a5d12e..577cb9e 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -1102,6 +1102,62 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
+@@ -1102,6 +1102,62 @@ out:
EXPORT_SYMBOL(nand_lock);
/**
return 0;
}
-@@ -1270,28 +1331,40 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd,
+@@ -1270,28 +1331,40 @@ static int nand_read_page_raw_syndrome(s
int eccbytes = chip->cur_ecc->bytes;
uint8_t *oob = chip->oob_poi;
int steps, size;
return 0;
}
-@@ -1380,7 +1453,8 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1380,7 +1453,8 @@ static int nand_read_subpage(struct mtd_
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1);
p = bufpoi + data_col_addr;
/* Calculate ECC */
for (i = 0; i < eccfrag_len;
-@@ -1399,7 +1473,8 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1399,7 +1473,8 @@ static int nand_read_subpage(struct mtd_
}
if (gaps) {
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, mtd->writesize, -1);
} else {
/*
* Send the command to read the particular ECC bytes take care
-@@ -1415,7 +1490,8 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1415,7 +1490,8 @@ static int nand_read_subpage(struct mtd_
chip->cmdfunc(mtd, NAND_CMD_RNDOUT,
mtd->writesize + aligned_pos, -1);
}
for (i = 0; i < eccfrag_len; i++)
-@@ -1436,6 +1512,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1436,6 +1512,7 @@ static int nand_read_subpage(struct mtd_
max_bitflips = max_t(unsigned int, max_bitflips, stat);
}
}
return max_bitflips;
}
-@@ -1460,13 +1537,17 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1460,13 +1537,17 @@ static int nand_read_page_hwecc(struct m
uint8_t *ecc_code = chip->buffers->ecccode;
uint32_t *eccpos = chip->cur_ecc->layout->eccpos;
unsigned int max_bitflips = 0;
for (i = 0; i < chip->cur_ecc->total; i++)
ecc_code[i] = chip->oob_poi[eccpos[i]];
-@@ -1486,6 +1567,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1486,6 +1567,7 @@ static int nand_read_page_hwecc(struct m
max_bitflips = max_t(unsigned int, max_bitflips, stat);
}
}
return max_bitflips;
}
-@@ -1514,11 +1596,14 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
+@@ -1514,11 +1596,14 @@ static int nand_read_page_hwecc_oob_firs
uint32_t *eccpos = chip->cur_ecc->layout->eccpos;
uint8_t *ecc_calc = chip->buffers->ecccalc;
unsigned int max_bitflips = 0;
for (i = 0; i < chip->cur_ecc->total; i++)
ecc_code[i] = chip->oob_poi[eccpos[i]];
-@@ -1527,7 +1612,8 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
+@@ -1527,7 +1612,8 @@ static int nand_read_page_hwecc_oob_firs
int stat;
chip->cur_ecc->hwctl(mtd, NAND_ECC_READ);
chip->cur_ecc->calculate(mtd, p, &ecc_calc[i]);
stat = chip->cur_ecc->correct(mtd, p, &ecc_code[i], NULL);
-@@ -1538,6 +1624,7 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
+@@ -1538,6 +1624,7 @@ static int nand_read_page_hwecc_oob_firs
max_bitflips = max_t(unsigned int, max_bitflips, stat);
}
}
return max_bitflips;
}
-@@ -1561,20 +1648,27 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1561,20 +1648,27 @@ static int nand_read_page_syndrome(struc
uint8_t *p = buf;
uint8_t *oob = chip->oob_poi;
unsigned int max_bitflips = 0;
stat = chip->cur_ecc->correct(mtd, p, oob, NULL);
if (stat < 0) {
-@@ -1587,29 +1681,36 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1587,29 +1681,36 @@ static int nand_read_page_syndrome(struc
oob += eccbytes;
if (chip->cur_ecc->postpad) {
switch (ops->mode) {
case MTD_OPS_PLACE_OOB:
-@@ -1737,6 +1838,7 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
+@@ -1737,6 +1838,7 @@ read_retry:
* Now read the page into the buffer. Absent an error,
* the read methods return max bitflips per ecc step.
*/
if (unlikely(ops->mode == MTD_OPS_RAW))
ret = chip->cur_ecc->read_page_raw(mtd, chip,
bufpoi,
-@@ -1753,6 +1855,8 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
+@@ -1753,6 +1855,8 @@ read_retry:
bufpoi,
oob_required,
page);
if (ret < 0) {
if (use_bufpoi)
/* Invalidate page cache */
-@@ -1780,8 +1884,8 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
+@@ -1780,8 +1884,8 @@ read_retry:
int toread = min(oobreadlen, max_oobsize);
if (toread) {
oobreadlen -= toread;
}
}
-@@ -1909,12 +2013,15 @@ static int nand_part_read(struct mtd_info *mtd, loff_t from, size_t len,
+@@ -1909,12 +2013,15 @@ static int nand_part_read(struct mtd_inf
nand_get_device(part->master, FL_READING);
if (part->ecc)
chip->cur_ecc = part->ecc;
chip->cur_ecc = &chip->ecc;
nand_release_device(part->master);
return ret;
-@@ -1930,7 +2037,9 @@ static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1930,7 +2037,9 @@ static int nand_read_oob_std(struct mtd_
int page)
{
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
return 0;
}
-@@ -1949,7 +2058,7 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1949,7 +2058,7 @@ static int nand_read_oob_syndrome(struct
chip->cur_ecc->postpad;
int eccsize = chip->cur_ecc->size;
uint8_t *bufpoi = chip->oob_poi;
chip->cmdfunc(mtd, NAND_CMD_READ0, chip->cur_ecc->size, page);
for (i = 0; i < chip->cur_ecc->steps; i++) {
-@@ -1962,12 +2071,17 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1962,12 +2071,17 @@ static int nand_read_oob_syndrome(struct
} else
sndrnd = 1;
toread = min_t(int, length, chunk);
return 0;
}
-@@ -1986,7 +2100,9 @@ static int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -1986,7 +2100,9 @@ static int nand_write_oob_std(struct mtd
int length = mtd->oobsize;
chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page);
/* Send command to program the OOB data */
chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
-@@ -2042,12 +2158,18 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,
+@@ -2042,12 +2158,18 @@ static int nand_write_oob_syndrome(struc
} else
sndcmd = 1;
len = min_t(int, length, chunk);
chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
status = chip->waitfunc(mtd, chip);
-@@ -2116,7 +2238,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -2116,7 +2238,7 @@ static int nand_do_read_oob(struct mtd_i
break;
len = min(len, readlen);
if (chip->options & NAND_NEED_READRDY) {
/* Apply delay or wait for ready/busy pin */
-@@ -2226,6 +2348,8 @@ static int nand_part_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -2226,6 +2348,8 @@ static int nand_part_read_oob(struct mtd
nand_get_device(part->master, FL_READING);
if (part->ecc)
chip->cur_ecc = part->ecc;
switch (ops->mode) {
case MTD_OPS_PLACE_OOB:
-@@ -2243,6 +2367,7 @@ static int nand_part_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -2243,6 +2367,7 @@ static int nand_part_read_oob(struct mtd
ret = nand_do_read_ops(part->master, from, ops);
out:
chip->cur_ecc = &chip->ecc;
nand_release_device(part->master);
return ret;
-@@ -2261,9 +2386,11 @@ static int nand_part_read_oob(struct mtd_info *mtd, loff_t from,
+@@ -2261,9 +2386,11 @@ out:
static int nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
return 0;
}
-@@ -2285,28 +2412,39 @@ static int nand_write_page_raw_syndrome(struct mtd_info *mtd,
+@@ -2285,28 +2412,39 @@ static int nand_write_page_raw_syndrome(
int eccbytes = chip->cur_ecc->bytes;
uint8_t *oob = chip->oob_poi;
int steps, size;
return 0;
}
-@@ -2353,17 +2491,21 @@ static int nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -2353,17 +2491,21 @@ static int nand_write_page_hwecc(struct
uint8_t *ecc_calc = chip->buffers->ecccalc;
const uint8_t *p = buf;
uint32_t *eccpos = chip->cur_ecc->layout->eccpos;
return 0;
}
-@@ -2399,7 +2541,9 @@ static int nand_write_subpage_hwecc(struct mtd_info *mtd,
+@@ -2399,7 +2541,9 @@ static int nand_write_subpage_hwecc(stru
chip->cur_ecc->hwctl(mtd, NAND_ECC_WRITE);
/* write data (untouched subpages already masked by 0xFF) */
/* mask ECC of un-touched subpages by padding 0xFF */
if ((step < start_step) || (step > end_step))
-@@ -2424,7 +2568,8 @@ static int nand_write_subpage_hwecc(struct mtd_info *mtd,
+@@ -2424,7 +2568,8 @@ static int nand_write_subpage_hwecc(stru
chip->oob_poi[eccpos[i]] = ecc_calc[i];
/* write OOB buffer to NAND device */
return 0;
}
-@@ -2449,31 +2594,42 @@ static int nand_write_page_syndrome(struct mtd_info *mtd,
+@@ -2449,31 +2594,42 @@ static int nand_write_page_syndrome(stru
int eccsteps = chip->cur_ecc->steps;
const uint8_t *p = buf;
uint8_t *oob = chip->oob_poi;
return 0;
}
-@@ -2504,6 +2660,7 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -2504,6 +2660,7 @@ static int nand_write_page(struct mtd_in
chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);
if (unlikely(raw))
status = chip->cur_ecc->write_page_raw(mtd, chip, buf,
oob_required);
-@@ -2514,6 +2671,7 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -2514,6 +2671,7 @@ static int nand_write_page(struct mtd_in
else
status = chip->cur_ecc->write_page(mtd, chip, buf,
oob_required);
if (status < 0)
return status;
-@@ -2803,6 +2961,8 @@ static int panic_nand_part_write(struct mtd_info *mtd, loff_t to, size_t len,
+@@ -2803,6 +2961,8 @@ static int panic_nand_part_write(struct
panic_nand_get_device(chip, part->master, FL_WRITING);
if (part->ecc)
chip->cur_ecc = part->ecc;
ops.len = len;
ops.datbuf = (uint8_t *)buf;
-@@ -2811,6 +2971,7 @@ static int panic_nand_part_write(struct mtd_info *mtd, loff_t to, size_t len,
+@@ -2811,6 +2971,7 @@ static int panic_nand_part_write(struct
ret = nand_do_write_ops(part->master, to, &ops);
chip->cur_ecc = &chip->ecc;
*retlen = ops.retlen;
return ret;
-@@ -2865,12 +3026,15 @@ static int nand_part_write(struct mtd_info *mtd, loff_t to, size_t len,
+@@ -2865,12 +3026,15 @@ static int nand_part_write(struct mtd_in
nand_get_device(part->master, FL_WRITING);
if (part->ecc)
chip->cur_ecc = part->ecc;
chip->cur_ecc = &chip->ecc;
nand_release_device(part->master);
return ret;
-@@ -3032,6 +3196,8 @@ static int nand_part_write_oob(struct mtd_info *mtd, loff_t to,
+@@ -3032,6 +3196,8 @@ static int nand_part_write_oob(struct mt
nand_get_device(part->master, FL_WRITING);
if (part->ecc)
chip->cur_ecc = part->ecc;
switch (ops->mode) {
case MTD_OPS_PLACE_OOB:
-@@ -3049,6 +3215,7 @@ static int nand_part_write_oob(struct mtd_info *mtd, loff_t to,
+@@ -3049,6 +3215,7 @@ static int nand_part_write_oob(struct mt
ret = nand_do_write_ops(part->master, to, ops);
out:
/* Allow subpage writes up to ecc.steps. Not possible for MLC flash */
if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) {
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 4f7ca8d..6cbd06a3 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
-@@ -539,6 +539,64 @@ void nand_page_set_status(struct mtd_info *mtd, int page,
+@@ -539,6 +539,64 @@ void nand_page_set_status(struct mtd_inf
int nand_pst_create(struct mtd_info *mtd);
void (*release)(struct nand_part *part);
};
-@@ -902,6 +965,41 @@ extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
+@@ -902,6 +965,41 @@ extern int nand_erase_nand(struct mtd_in
extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, uint8_t *buf);
include/linux/of_mtd.h | 6 ++++++
2 files changed, 41 insertions(+)
-diff --git a/drivers/of/of_mtd.c b/drivers/of/of_mtd.c
-index b7361ed..4e42c26 100644
--- a/drivers/of/of_mtd.c
+++ b/drivers/of/of_mtd.c
-@@ -84,6 +84,41 @@ int of_get_nand_ecc_strength(struct device_node *np)
+@@ -84,6 +84,41 @@ int of_get_nand_ecc_strength(struct devi
EXPORT_SYMBOL_GPL(of_get_nand_ecc_strength);
/**
* of_get_nand_bus_width - Get nand bus witdh for given device_node
* @np: Pointer to the given device_node
*
-diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
-index e266caa..1059472 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -15,6 +15,7 @@
int of_get_nand_bus_width(struct device_node *np);
bool of_get_nand_on_flash_bbt(struct device_node *np);
-@@ -35,6 +36,11 @@ static inline int of_get_nand_ecc_strength(struct device_node *np)
+@@ -34,6 +35,11 @@ static inline int of_get_nand_ecc_streng
+ {
return -ENOSYS;
}
-
++
+static inline int of_get_nand_rnd_mode(struct device_node *np)
+{
+ return -ENOSYS;
+}
-+
+
static inline int of_get_nand_bus_width(struct device_node *np)
{
- return -ENOSYS;
include/linux/mtd/nand.h | 4 ++++
2 files changed, 11 insertions(+)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index 577cb9e..51642c6 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -4382,6 +4382,13 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+@@ -4382,6 +4382,13 @@ ident_done:
if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
chip->cmdfunc = nand_command_lp;
pr_info("device found, Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
*maf_id, *dev_id);
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 6cbd06a3..5844d6f 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -748,6 +748,9 @@ struct nand_chip {
4 files changed, 164 insertions(+), 2 deletions(-)
create mode 100644 drivers/mtd/nand/nand_hynix.c
-diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
-index fcbe032..07b7c8c 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -5,7 +5,7 @@
obj-$(CONFIG_MTD_SM_COMMON) += sm_common.o
obj-$(CONFIG_MTD_NAND_CAFE) += cafe_nand.o
-diff --git a/drivers/mtd/nand/nand_hynix.c b/drivers/mtd/nand/nand_hynix.c
-new file mode 100644
-index 0000000..0d051bf5
--- /dev/null
+++ b/drivers/mtd/nand/nand_hynix.c
@@ -0,0 +1,159 @@
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Boris BREZILLON <b.brezillon.dev@gmail.com>");
+MODULE_DESCRIPTION("Hynix NAND specific code");
-diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
-index dd620c1..b786718 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
-@@ -163,6 +163,7 @@ struct nand_flash_dev nand_flash_ids[] = {
+@@ -163,6 +163,7 @@ struct nand_flash_dev nand_flash_ids[] =
{NULL}
};
/* Manufacturer IDs */
struct nand_manufacturers nand_manuf_ids[] = {
{NAND_MFR_TOSHIBA, "Toshiba"},
-@@ -171,7 +172,7 @@ struct nand_manufacturers nand_manuf_ids[] = {
+@@ -171,7 +172,7 @@ struct nand_manufacturers nand_manuf_ids
{NAND_MFR_NATIONAL, "National"},
{NAND_MFR_RENESAS, "Renesas"},
{NAND_MFR_STMICRO, "ST Micro"},
{NAND_MFR_MICRON, "Micron"},
{NAND_MFR_AMD, "AMD/Spansion"},
{NAND_MFR_MACRONIX, "Macronix"},
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 5844d6f..328aab2 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -959,6 +959,8 @@ struct nand_manufacturers {
include/linux/mtd/nand.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 328aab2..c20f35b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -176,17 +176,17 @@ typedef enum {
drivers/mtd/nand/nand_base.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index 51642c6..e3d4d8e 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -4063,6 +4063,41 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -4063,6 +4063,41 @@ static void nand_decode_ext_id(struct mt
mtd->erasesize = (128 * 1024) <<
(((extid >> 1) & 0x04) | (extid & 0x03));
*busw = 0;
drivers/mtd/nand/nand_base.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index e3d4d8e..5c6f465 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -4437,9 +4437,11 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+@@ -4437,9 +4437,11 @@ ident_done:
pr_info("%s %s\n", nand_manuf_ids[maf_idx].name,
type->name);
drivers/mtd/nand/nand_base.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index 5c6f465..05ec786 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -4247,7 +4247,7 @@ static inline bool is_full_id_nand(struct nand_flash_dev *type)
+@@ -4247,7 +4247,7 @@ static inline bool is_full_id_nand(struc
}
static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
{
if (!strncmp(type->id, id_data, type->id_len)) {
mtd->writesize = type->pagesize;
-@@ -4273,6 +4273,21 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -4273,6 +4273,21 @@ static bool find_full_id_nand(struct mtd
}
/*
* Get the flash and manufacturer id and lookup if the type is supported.
*/
static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
-@@ -4385,8 +4400,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+@@ -4385,8 +4400,7 @@ ident_done:
* Check, if buswidth is correct. Hardware drivers should set
* chip correct!
*/
pr_info("%s %s\n", nand_manuf_ids[maf_idx].name, mtd->name);
pr_warn("bus width %d instead %d bit\n",
(chip->options & NAND_BUSWIDTH_16) ? 16 : 8,
-@@ -4424,8 +4438,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+@@ -4424,8 +4438,7 @@ ident_done:
return ERR_PTR(err);
}
drivers/mtd/nand/sunxi_nand.c | 73 +++++++++++++++++++++++++++++++++++++------
2 files changed, 65 insertions(+), 9 deletions(-)
-diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
-index 8242470..7df88c6 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -525,6 +525,7 @@ config MTD_NAND_XWAY
help
Enables support for NAND Flash chips on Allwinner SoCs.
-diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
-index 6f93b29..c3e0473 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -202,6 +202,23 @@ struct sunxi_nand_hw_ecc {
* NAND chip structure: stores NAND chip device related information
*
* @node: used to store NAND chips into a list
-@@ -521,7 +538,7 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -521,7 +538,7 @@ static int sunxi_nfc_hw_ecc_read_page(st
int oob_required, int page)
{
struct sunxi_nfc *nfc = to_sunxi_nfc(chip->controller);
struct nand_ecclayout *layout = ecc->layout;
struct sunxi_nand_hw_ecc *data = ecc->priv;
unsigned int max_bitflips = 0;
-@@ -607,7 +624,7 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -607,7 +624,7 @@ static int sunxi_nfc_hw_ecc_write_page(s
const uint8_t *buf, int oob_required)
{
struct sunxi_nfc *nfc = to_sunxi_nfc(chip->controller);
struct nand_ecclayout *layout = ecc->layout;
struct sunxi_nand_hw_ecc *data = ecc->priv;
int offset;
-@@ -681,7 +698,7 @@ static int sunxi_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
+@@ -681,7 +698,7 @@ static int sunxi_nfc_hw_syndrome_ecc_rea
int page)
{
struct sunxi_nfc *nfc = to_sunxi_nfc(chip->controller);
struct sunxi_nand_hw_ecc *data = ecc->priv;
unsigned int max_bitflips = 0;
uint8_t *oob = chip->oob_poi;
-@@ -749,7 +766,7 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -749,7 +766,7 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
int oob_required)
{
struct sunxi_nfc *nfc = to_sunxi_nfc(chip->controller);
struct sunxi_nand_hw_ecc *data = ecc->priv;
uint8_t *oob = chip->oob_poi;
int offset = 0;
-@@ -1099,8 +1116,13 @@ static int sunxi_nand_ecc_init(struct mtd_info *mtd, struct nand_ecc_ctrl *ecc,
+@@ -1099,8 +1116,13 @@ static int sunxi_nand_ecc_init(struct mt
ecc->strength = nand->ecc_strength_ds;
}
ecc->mode = NAND_ECC_HW;
-@@ -1135,12 +1157,39 @@ static int sunxi_nand_ecc_init(struct mtd_info *mtd, struct nand_ecc_ctrl *ecc,
+@@ -1135,12 +1157,39 @@ static int sunxi_nand_ecc_init(struct mt
return 0;
}
struct mtd_info *mtd;
struct nand_chip *nand;
int nsels;
-@@ -1269,8 +1318,14 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
+@@ -1269,8 +1318,14 @@ static int sunxi_nand_chip_init(struct d
return ret;
}
drivers/mtd/nand/sunxi_nand.c | 603 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 585 insertions(+), 18 deletions(-)
-diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
-index c3e0473..2f6ab39 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -206,10 +206,12 @@ struct sunxi_nand_hw_ecc {
};
static inline struct sunxi_nand_part *
-@@ -219,6 +221,29 @@ to_sunxi_nand_part(struct nand_part *part)
+@@ -219,6 +221,29 @@ to_sunxi_nand_part(struct nand_part *par
}
/*
unsigned long clk_rate;
int selected;
int nsels;
-@@ -489,6 +515,185 @@ static void sunxi_nfc_write_buf(struct mtd_info *mtd, const uint8_t *buf,
+@@ -489,6 +515,185 @@ static void sunxi_nfc_write_buf(struct m
}
}
static uint8_t sunxi_nfc_read_byte(struct mtd_info *mtd)
{
uint8_t ret;
-@@ -538,16 +743,43 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -538,16 +743,43 @@ static int sunxi_nfc_hw_ecc_read_page(st
int oob_required, int page)
{
struct sunxi_nfc *nfc = to_sunxi_nfc(chip->controller);
tmp = readl(nfc->regs + NFC_REG_ECC_CTL);
tmp &= ~(NFC_ECC_MODE | NFC_ECC_PIPELINE | NFC_ECC_BLOCK_SIZE);
tmp |= NFC_ECC_EN | (data->mode << NFC_ECC_MODE_SHIFT) |
-@@ -556,12 +788,15 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -556,12 +788,15 @@ static int sunxi_nfc_hw_ecc_read_page(st
writel(tmp, nfc->regs + NFC_REG_ECC_CTL);
for (i = 0; i < ecc->steps; i++) {
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, offset, -1);
-@@ -569,6 +804,25 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -569,6 +804,25 @@ static int sunxi_nfc_hw_ecc_read_page(st
if (ret)
return ret;
tmp = NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD | (1 << 30);
writel(tmp, nfc->regs + NFC_REG_CMD);
-@@ -579,6 +833,9 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -579,6 +833,9 @@ static int sunxi_nfc_hw_ecc_read_page(st
memcpy_fromio(buf + (i * ecc->size),
nfc->regs + NFC_RAM0_BASE, ecc->size);
if (readl(nfc->regs + NFC_REG_ECC_ST) & 0x1) {
mtd->ecc_stats.failed++;
} else {
-@@ -594,9 +851,10 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -594,9 +851,10 @@ static int sunxi_nfc_hw_ecc_read_page(st
if (ret)
return ret;
}
}
-@@ -606,11 +864,14 @@ static int sunxi_nfc_hw_ecc_read_page(struct mtd_info *mtd,
+@@ -606,11 +864,14 @@ static int sunxi_nfc_hw_ecc_read_page(st
offset = mtd->writesize +
ecc->layout->oobfree[ecc->steps].offset;
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, offset, -1);
tmp = readl(nfc->regs + NFC_REG_ECC_CTL);
tmp &= ~NFC_ECC_EN;
-@@ -627,6 +888,7 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -627,6 +888,7 @@ static int sunxi_nfc_hw_ecc_write_page(s
struct nand_ecc_ctrl *ecc = chip->cur_ecc;
struct nand_ecclayout *layout = ecc->layout;
struct sunxi_nand_hw_ecc *data = ecc->priv;
int offset;
int ret;
u32 tmp;
-@@ -641,22 +903,56 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -641,22 +903,56 @@ static int sunxi_nfc_hw_ecc_write_page(s
writel(tmp, nfc->regs + NFC_REG_ECC_CTL);
for (i = 0; i < ecc->steps; i++) {
}
chip->cmdfunc(mtd, NAND_CMD_RNDIN, offset, -1);
-@@ -671,6 +967,9 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -671,6 +967,9 @@ static int sunxi_nfc_hw_ecc_write_page(s
ret = sunxi_nfc_wait_int(nfc, NFC_CMD_INT_FLAG, 0);
if (ret)
return ret;
}
if (oob_required) {
-@@ -679,11 +978,14 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -679,11 +978,14 @@ static int sunxi_nfc_hw_ecc_write_page(s
offset = mtd->writesize +
ecc->layout->oobfree[i].offset;
chip->cmdfunc(mtd, NAND_CMD_RNDIN, offset, -1);
tmp = readl(nfc->regs + NFC_REG_ECC_CTL);
tmp &= ~NFC_ECC_EN;
-@@ -692,22 +994,76 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -692,22 +994,76 @@ static int sunxi_nfc_hw_ecc_write_page(s
return 0;
}
tmp = readl(nfc->regs + NFC_REG_ECC_CTL);
tmp &= ~(NFC_ECC_MODE | NFC_ECC_PIPELINE | NFC_ECC_BLOCK_SIZE);
tmp |= NFC_ECC_EN | (data->mode << NFC_ECC_MODE_SHIFT) |
-@@ -716,7 +1072,17 @@ static int sunxi_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
+@@ -716,7 +1072,17 @@ static int sunxi_nfc_hw_syndrome_ecc_rea
writel(tmp, nfc->regs + NFC_REG_ECC_CTL);
for (i = 0; i < ecc->steps; i++) {
tmp = NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD | (1 << 30);
writel(tmp, nfc->regs + NFC_REG_CMD);
-@@ -729,6 +1095,9 @@ static int sunxi_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
+@@ -729,6 +1095,9 @@ static int sunxi_nfc_hw_syndrome_ecc_rea
buf += ecc->size;
offset += ecc->size;
if (readl(nfc->regs + NFC_REG_ECC_ST) & 0x1) {
mtd->ecc_stats.failed++;
} else {
-@@ -739,7 +1108,8 @@ static int sunxi_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
+@@ -739,7 +1108,8 @@ static int sunxi_nfc_hw_syndrome_ecc_rea
if (oob_required) {
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, offset, -1);
oob += ecc->bytes + ecc->prepad;
}
-@@ -750,10 +1120,13 @@ static int sunxi_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
+@@ -750,10 +1120,13 @@ static int sunxi_nfc_hw_syndrome_ecc_rea
cnt = mtd->oobsize - (oob - chip->oob_poi);
if (cnt > 0) {
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, offset, -1);
writel(readl(nfc->regs + NFC_REG_ECC_CTL) & ~NFC_ECC_EN,
nfc->regs + NFC_REG_ECC_CTL);
-@@ -768,6 +1141,7 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -768,6 +1141,7 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
struct sunxi_nfc *nfc = to_sunxi_nfc(chip->controller);
struct nand_ecc_ctrl *ecc = chip->cur_ecc;
struct sunxi_nand_hw_ecc *data = ecc->priv;
uint8_t *oob = chip->oob_poi;
int offset = 0;
int ret;
-@@ -783,7 +1157,8 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -783,7 +1157,8 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
writel(tmp, nfc->regs + NFC_REG_ECC_CTL);
for (i = 0; i < ecc->steps; i++) {
offset += ecc->size;
/* Fill OOB data in */
-@@ -796,6 +1171,16 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -796,6 +1171,16 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
4);
}
tmp = NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD | NFC_ACCESS_DIR |
(1 << 30);
writel(tmp, nfc->regs + NFC_REG_CMD);
-@@ -804,6 +1189,9 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -804,6 +1189,9 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
if (ret)
return ret;
offset += ecc->bytes + ecc->prepad;
oob += ecc->bytes + ecc->prepad;
}
-@@ -812,9 +1200,11 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -812,9 +1200,11 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
cnt = mtd->oobsize - (oob - chip->oob_poi);
if (cnt > 0) {
chip->cmdfunc(mtd, NAND_CMD_RNDIN, offset, -1);
tmp = readl(nfc->regs + NFC_REG_ECC_CTL);
tmp &= ~NFC_ECC_EN;
-@@ -824,6 +1214,128 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -824,6 +1214,128 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
return 0;
}
static int sunxi_nand_chip_set_timings(struct sunxi_nand_chip *chip,
const struct nand_sdr_timings *timings)
{
-@@ -1084,6 +1596,40 @@ static int sunxi_nand_hw_syndrome_ecc_ctrl_init(struct mtd_info *mtd,
+@@ -1084,6 +1596,40 @@ static int sunxi_nand_hw_syndrome_ecc_ct
return 0;
}
static void sunxi_nand_ecc_cleanup(struct nand_ecc_ctrl *ecc)
{
switch (ecc->mode) {
-@@ -1175,7 +1721,14 @@ struct nand_part *sunxi_ofnandpart_parse(void *priv, struct mtd_info *master,
+@@ -1175,7 +1721,14 @@ struct nand_part *sunxi_ofnandpart_parse
if (ret)
goto err;
return &part->part;
-@@ -1300,18 +1853,30 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
+@@ -1300,18 +1853,30 @@ static int sunxi_nand_chip_init(struct d
if (ret)
return ret;
ret = nand_scan_tail(mtd);
if (ret) {
dev_err(dev, "nand_scan_tail failed: %d\n", ret);
-@@ -1367,6 +1932,8 @@ static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
+@@ -1367,6 +1932,8 @@ static void sunxi_nand_chips_cleanup(str
node);
nand_release(&chip->mtd);
sunxi_nand_ecc_cleanup(&chip->nand.ecc);
drivers/mtd/nand/sunxi_nand.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
-diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
-index 2f6ab39..74f2caf 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -1711,28 +1711,37 @@ static void sunxi_nand_part_release(struct nand_part *part)
+@@ -1711,28 +1711,37 @@ static void sunxi_nand_part_release(stru
struct nand_part *sunxi_ofnandpart_parse(void *priv, struct mtd_info *master,
struct device_node *pp)
{
- ret = sunxi_nand_ecc_init(master, &part->ecc, pp);
- if (ret)
- goto err;
-+ if (of_find_property(pp, "nand-ecc-mode", NULL)) {
-+ ret = sunxi_nand_ecc_init(master, &part->ecc, pp);
-+ if (ret)
-+ goto err;
-
+-
- ret = sunxi_nand_rnd_init(master, &part->rnd, &part->ecc, pp);
- if (ret) {
- sunxi_nand_ecc_cleanup(&part->ecc);
- goto err;
++ if (of_find_property(pp, "nand-ecc-mode", NULL)) {
++ ret = sunxi_nand_ecc_init(master, &part->ecc, pp);
++ if (ret)
++ goto err;
++
+ part->part.ecc = &part->ecc;
}
drivers/mtd/nand/sunxi_nand.c | 9 +++++++++
1 file changed, 9 insertions(+)
-diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
-index 74f2caf..72ab770 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -1853,6 +1853,15 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
+@@ -1853,6 +1853,15 @@ static int sunxi_nand_chip_init(struct d
if (of_get_nand_on_flash_bbt(np))
nand->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
arch/arm/boot/dts/sun4i-a10.dtsi | 80 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
-diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
-index abea24e..e0a737f 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
-@@ -924,6 +924,86 @@
+@@ -774,6 +774,86 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
arch/arm/boot/dts/sun5i.dtsi | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
-diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
-index f11efb7..1962ec9 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
-@@ -201,6 +201,20 @@
- allwinner,drive = <SUN4I_PINCTRL_30_MA>;
- allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+@@ -656,4 +656,18 @@
+ clocks = <&ahb_gates 28>;
+ };
};
+
+ nand_cs2_pins_a: nand_cs@2 {
+ allwinner,pull = <0>;
+ };
};
-
- &sram_a {
-diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
-index 772f8d8..0dc7c96 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
-@@ -544,6 +544,44 @@
+@@ -528,6 +528,44 @@
allwinner,drive = <SUN4I_PINCTRL_30_MA>;
- allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
+
+ nand_pins_a: nand_base0@0 {
arch/arm/boot/dts/sun7i-a20.dtsi | 80 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 0d7e600..6ec86c9 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -1164,6 +1164,86 @@
+@@ -978,6 +978,86 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
arch/arm/boot/dts/sun7i-a20.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 6ec86c9..092adc6 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -641,6 +641,17 @@
+@@ -543,6 +543,17 @@
#dma-cells = <2>;
};
arch/arm/boot/dts/sun4i-a10.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
-diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
-index e0a737f..7cd636d 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
-@@ -514,6 +514,17 @@
+@@ -428,6 +428,17 @@
#dma-cells = <2>;
};
arch/arm/boot/dts/sun5i.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
-diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
-index 0dc7c96..801ab01 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
-@@ -353,6 +353,17 @@
+@@ -365,6 +365,17 @@
#dma-cells = <2>;
};
arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 59 +++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
-diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
-index b3c234c..fd1e921 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
-@@ -155,3 +155,62 @@
- status = "okay";
- };
+@@ -201,3 +201,62 @@
+ status = "okay";
+ };
};
+&nfc {
+ pinctrl-names = "default";
-diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
-index 39a51d5..f35957d 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
-@@ -142,3 +142,60 @@
- status = "okay";
- };
+@@ -245,3 +245,60 @@
+ status = "okay";
+ };
};
+&nfc {
+ pinctrl-names = "default";
arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 57 ++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
-diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
-index 046a84d..a6faca3 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
-@@ -147,3 +147,60 @@
- regulator-max-microvolt = <3000000>;
- regulator-name = "avcc";
+@@ -215,3 +215,60 @@
+ regulator-max-microvolt = <3000000>;
+ regulator-name = "avcc";
};
+&nfc {
+ pinctrl-names = "default";
-diff --git a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
-index b3c234c..fd1e921 100644
--- a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
+++ b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
-@@ -155,3 +155,62 @@
- status = "okay";
- };
+@@ -189,3 +189,62 @@
+ status = "okay";
+ };
};
+&nfc {
+ pinctrl-names = "default";
-diff --git a/arch/arm/boot/dts/sun4i-a10-pcduino.dts b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
-index b3c234c..fd1e921 100644
--- a/arch/arm/boot/dts/sun4i-a10-pcduino.dts
+++ b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
-@@ -155,3 +155,62 @@
- status = "okay";
- };
+@@ -194,3 +194,62 @@
+ status = "okay";
+ };
};
+&nfc {
+ pinctrl-names = "default";
-diff --git a/arch/arm/boot/dts/sun7i-a20-pcduino3.dts b/arch/arm/boot/dts/sun7i-a20-pcduino3.dts
-index b3c234c..fd1e921 100644
--- a/arch/arm/boot/dts/sun7i-a20-pcduino3.dts
+++ b/arch/arm/boot/dts/sun7i-a20-pcduino3.dts
-@@ -155,3 +155,62 @@
- status = "okay";
- };
+@@ -210,3 +210,62 @@
+ status = "okay";
+ };
};
+&nfc {
+ pinctrl-names = "default";
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index c2e1232..f561c68 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -3611,6 +3611,8 @@ static inline bool is_full_id_nand(struct nand_flash_dev *type)
+@@ -4249,6 +4249,8 @@ static inline bool is_full_id_nand(struc
static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
- struct nand_flash_dev *type, u8 *id_data, int *busw)
+ struct nand_flash_dev *type, const u8 *id_data, int *busw)
{
+ int mode;
+
if (!strncmp(type->id, id_data, type->id_len)) {
mtd->writesize = type->pagesize;
mtd->erasesize = type->erasesize;
-@@ -3621,8 +3623,9 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -4259,8 +4261,9 @@ static bool find_full_id_nand(struct mtd
chip->options |= type->options;
chip->ecc_strength_ds = NAND_ECC_STRENGTH(type);
chip->ecc_step_ds = NAND_ECC_STEP(type);
*busw = type->options & NAND_BUSWIDTH_16;
-diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
-index 5095a32..72e4135 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -1083,7 +1083,7 @@ static int sunxi_nand_chip_init_timings(struct sunxi_nand_chip *chip,
+@@ -1427,7 +1427,7 @@ static int sunxi_nand_chip_init_timings(
mode = onfi_get_async_timing_mode(&chip->nand);
if (mode == ONFI_TIMING_MODE_UNKNOWN) {
} else {
uint8_t feature[ONFI_SUBFEATURE_PARAM_LEN] = {};
-@@ -1097,9 +1097,10 @@ static int sunxi_nand_chip_init_timings(struct sunxi_nand_chip *chip,
+@@ -1441,9 +1441,10 @@ static int sunxi_nand_chip_init_timings(
feature);
if (ret)
return ret;
if (IS_ERR(timings))
return PTR_ERR(timings);
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 3d4ea7e..2eb92a3 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
-@@ -536,6 +536,55 @@ struct nand_buffers {
+@@ -612,6 +612,55 @@ struct nand_buffers {
uint8_t *databuf;
};
/**
* struct nand_chip - NAND Private Flash Chip Data
* @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the
-@@ -600,11 +649,7 @@ struct nand_buffers {
+@@ -676,11 +725,7 @@ struct nand_buffers {
* @ecc_step_ds: [INTERN] ECC step required by the @ecc_strength_ds,
* also from the datasheet. It is the recommended ECC step
* size, if known; if unknown, set to zero.
* @numchips: [INTERN] number of physical chips
* @chipsize: [INTERN] the size of one chip for multichip arrays
* @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
-@@ -689,7 +734,7 @@ struct nand_chip {
+@@ -769,7 +814,7 @@ struct nand_chip {
uint8_t bits_per_cell;
uint16_t ecc_strength_ds;
uint16_t ecc_step_ds;
int badblockpos;
int badblockbits;
-@@ -975,55 +1020,6 @@ static inline int jedec_feature(struct nand_chip *chip)
- : 0;
- }
+@@ -1156,55 +1201,6 @@ struct ofnandpart_data {
+ int ofnandpart_parse(struct mtd_info *master,
+ const struct ofnandpart_data *data);
-/*
- * struct nand_sdr_timings - SDR NAND chip timings
-diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
-index f561c68..8e636df 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
-@@ -3624,8 +3624,13 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
+@@ -4262,8 +4262,13 @@ static bool find_full_id_nand(struct mtd
chip->ecc_strength_ds = NAND_ECC_STRENGTH(type);
chip->ecc_step_ds = NAND_ECC_STEP(type);
*busw = type->options & NAND_BUSWIDTH_16;
-diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
-index 2eb92a3..7d9e599 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
-@@ -863,6 +863,7 @@ struct nand_flash_dev {
+@@ -988,6 +988,7 @@ struct nand_flash_dev {
uint16_t step_ds;
} ecc;
int onfi_timing_mode_default;
-diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
-index dd620c1..15b4a03 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -19,6 +19,49 @@
* The chip ID list:
* name, device ID, page size, chip size in MiB, eraseblock size, options
*
-@@ -50,6 +93,10 @@ struct nand_flash_dev nand_flash_ids[] = {
+@@ -50,6 +93,10 @@ struct nand_flash_dev nand_flash_ids[] =
{ .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} },
SZ_8K, SZ_8K, SZ_2M, 0, 6, 640, NAND_ECC_INFO(40, SZ_1K),
4 },
drivers/mtd/nand/sunxi_nand.c | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
-diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
-index 72ab770..3668197 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -904,7 +904,7 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -904,7 +904,7 @@ static int sunxi_nfc_hw_ecc_write_page(s
for (i = 0; i < ecc->steps; i++) {
bool rndactiv = false;
if (i)
chip->cmdfunc(mtd, NAND_CMD_RNDIN, i * ecc->size, -1);
-@@ -915,15 +915,13 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -915,15 +915,13 @@ static int sunxi_nfc_hw_ecc_write_page(s
offset = layout->eccpos[i * ecc->bytes] - 4 + mtd->writesize;
/* Fill OOB data in */
if (i) {
cnt = ecc->bytes + 4;
-@@ -942,12 +940,16 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -942,12 +940,16 @@ static int sunxi_nfc_hw_ecc_write_page(s
if (rndactiv) {
/* pre randomize to generate FF patterns on the NAND */
if (!i) {
}
tmp = readl(nfc->regs + NFC_REG_ECC_CTL);
tmp &= ~(NFC_RANDOM_DIRECTION | NFC_ECC_EXCEPTION);
-@@ -955,6 +957,8 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
+@@ -955,6 +957,8 @@ static int sunxi_nfc_hw_ecc_write_page(s
writel(tmp, nfc->regs + NFC_REG_ECC_CTL);
}
chip->cmdfunc(mtd, NAND_CMD_RNDIN, offset, -1);
ret = sunxi_nfc_wait_cmd_fifo_empty(nfc);
-@@ -1164,13 +1168,13 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
+@@ -1164,13 +1168,13 @@ static int sunxi_nfc_hw_syndrome_ecc_wri
/* Fill OOB data in */
if (oob_required) {
tmp = 0xffffffff;
drivers/mmc/host/sunxi-mmc.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
-diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
-index 4d3e1ff..daa90b7 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
-@@ -289,6 +289,24 @@ static int sunxi_mmc_init_host(struct mmc_host *mmc)
+@@ -289,6 +289,24 @@ static int sunxi_mmc_init_host(struct mm
return 0;
}
static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
struct mmc_data *data)
{
-@@ -383,6 +401,8 @@ static void sunxi_mmc_send_manual_stop(struct sunxi_mmc_host *host,
+@@ -383,6 +401,8 @@ static void sunxi_mmc_send_manual_stop(s
u32 arg, cmd_val, ri;
unsigned long expire = jiffies + msecs_to_jiffies(1000);
cmd_val = SDXC_START | SDXC_RESP_EXPIRE |
SDXC_STOP_ABORT_CMD | SDXC_CHECK_RESPONSE_CRC;
-@@ -597,6 +617,11 @@ static int sunxi_mmc_oclk_onoff(struct sunxi_mmc_host *host, u32 oclk_en)
+@@ -597,6 +617,11 @@ static int sunxi_mmc_oclk_onoff(struct s
{
unsigned long expire = jiffies + msecs_to_jiffies(250);
u32 rval;
rval = mmc_readl(host, REG_CLKCR);
rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON);
-@@ -785,6 +810,13 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
+@@ -784,6 +809,13 @@ static void sunxi_mmc_request(struct mmc
+ mmc_request_done(mmc, mrq);
return;
}
-
++
+ ret = sunxi_mmc_wait_card_ready(host);
+ if (ret) {
+ mrq->cmd->error = ret;
+ mmc_request_done(mmc, mrq);
+ return;
+ }
-+
+
if (data) {
ret = sunxi_mmc_map_dma(host, data);
- if (ret < 0) {
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 6a63f30..f5f384c 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -107,7 +107,7 @@
+@@ -111,7 +111,7 @@
720000 1200000
528000 1100000
312000 1000000
Signed-off-by: Jens Kuske <jenskuske@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
-diff --git a/Documentation/devicetree/bindings/arm/sunxi.txt b/Documentation/devicetree/bindings/arm/sunxi.txt
-index 42941fd..3cb4b94 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.txt
+++ b/Documentation/devicetree/bindings/arm/sunxi.txt
-@@ -9,4 +9,5 @@ using one of the following compatible strings:
+@@ -9,4 +9,5 @@ using one of the following compatible st
allwinner,sun6i-a31
allwinner,sun7i-a20
allwinner,sun8i-a23
+ allwinner,sun8i-h3
allwinner,sun9i-a80
-diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
-index 81502b9..4efe2d4 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -35,7 +35,7 @@ config MACH_SUN7I
default ARCH_SUNXI
select ARM_GIC
select MFD_SUN6I_PRCM
-diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
-index 1bc811a..8270902 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -67,10 +67,12 @@ MACHINE_END
.dt_compat = sun8i_board_dt_compat,
.init_late = sunxi_dt_cpufreq_init,
MACHINE_END
---
-cgit v0.10.2
-
-diff --git a/Documentation/devicetree/bindings/dma/sun6i-dma.txt b/Documentation/devicetree/bindings/dma/sun6i-dma.txt
-index 9cdcba24d..d13c136 100644
--- a/Documentation/devicetree/bindings/dma/sun6i-dma.txt
+++ b/Documentation/devicetree/bindings/dma/sun6i-dma.txt
-@@ -4,7 +4,10 @@ This driver follows the generic DMA bindings defined in dma.txt.
+@@ -4,7 +4,10 @@ This driver follows the generic DMA bind
Required properties:
- reg: Should contain the registers base address and length
- interrupts: Should contain a reference to the interrupt used by this device
- clocks: Should contain a reference to the parent AHB clock
-diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
-index 11e5365..842ff97 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
-@@ -891,9 +891,21 @@ static struct sun6i_dma_config sun8i_a23_dma_cfg = {
+@@ -891,9 +891,21 @@ static struct sun6i_dma_config sun8i_a23
.nr_max_vchans = 37,
};
create mode 100644 Documentation/devicetree/bindings/dma/sun4i-dma.txt
create mode 100644 drivers/dma/sun4i-dma.c
-diff --git a/Documentation/devicetree/bindings/dma/sun4i-dma.txt b/Documentation/devicetree/bindings/dma/sun4i-dma.txt
-new file mode 100644
-index 0000000..f1634a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/sun4i-dma.txt
@@ -0,0 +1,46 @@
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
-diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
-index fd7ac13..12372c2 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
-@@ -443,6 +443,17 @@ config XGENE_DMA
+@@ -444,6 +444,17 @@ config XGENE_DMA
help
Enable support for the APM X-Gene SoC DMA engine.
config DMA_ENGINE
bool
-diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
-index 69f77d5..3eba5e9 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -54,3 +54,4 @@ obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
+obj-$(CONFIG_SUN4I_DMA) += sun4i-dma.o
-diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
-new file mode 100644
-index 0000000..a8d55518
--- /dev/null
+++ b/drivers/dma/sun4i-dma.c
@@ -0,0 +1,1235 @@
2 files changed, 250 insertions(+)
create mode 100644 drivers/clk/sunxi/clk-a10-pll2.c
-diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
-index 058f273..eb36c38 100644
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -4,6 +4,7 @@
obj-y += clk-a20-gmac.o
obj-y += clk-mod0.o
obj-y += clk-sun8i-mbus.o
-diff --git a/drivers/clk/sunxi/clk-a10-pll2.c b/drivers/clk/sunxi/clk-a10-pll2.c
-new file mode 100644
-index 0000000..bdbf1e9
--- /dev/null
+++ b/drivers/clk/sunxi/clk-a10-pll2.c
@@ -0,0 +1,249 @@
2 files changed, 42 insertions(+)
create mode 100644 drivers/clk/sunxi/clk-a10-codec.c
-diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
-index eb36c38..6fa845e 100644
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -3,6 +3,7 @@
obj-y += clk-a10-hosc.o
obj-y += clk-a10-pll2.o
obj-y += clk-a20-gmac.o
-diff --git a/drivers/clk/sunxi/clk-a10-codec.c b/drivers/clk/sunxi/clk-a10-codec.c
-new file mode 100644
-index 0000000..c70acbf
--- /dev/null
+++ b/drivers/clk/sunxi/clk-a10-codec.c
@@ -0,0 +1,41 @@
2 files changed, 70 insertions(+)
create mode 100644 drivers/clk/sunxi/clk-a10-mod1.c
-diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
-index 6fa845e..960eeab 100644
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -5,6 +5,7 @@
obj-y += clk-a10-pll2.o
obj-y += clk-a20-gmac.o
obj-y += clk-mod0.o
-diff --git a/drivers/clk/sunxi/clk-a10-mod1.c b/drivers/clk/sunxi/clk-a10-mod1.c
-new file mode 100644
-index 0000000..1357641
--- /dev/null
+++ b/drivers/clk/sunxi/clk-a10-mod1.c
@@ -0,0 +1,69 @@
arch/arm/boot/dts/sun7i-a20.dtsi | 8 ++++++++
3 files changed, 24 insertions(+)
-diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
-index 30f663a..fab13af 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
-@@ -195,6 +195,14 @@
+@@ -162,6 +162,14 @@
clock-output-names = "pll1";
};
pll4: clk@01c20018 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-pll1-clk";
-diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
-index 53d3ead..a4b6a66 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
-@@ -102,6 +102,14 @@
+@@ -136,6 +136,14 @@
clock-output-names = "pll1";
};
pll4: clk@01c20018 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-pll1-clk";
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 7549f1b..12d9ffd 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -199,6 +199,14 @@
+@@ -203,6 +203,14 @@
clock-output-names = "pll1";
};
arch/arm/boot/dts/sun7i-a20.dtsi | 8 ++++++++
3 files changed, 24 insertions(+)
-diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
-index fab13af..abea24e 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
-@@ -454,6 +454,14 @@
+@@ -420,6 +420,14 @@
clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
clock-output-names = "spi3";
};
};
soc@01c00000 {
-diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
-index a4b6a66..5c0edd6 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
-@@ -292,6 +292,14 @@
+@@ -350,6 +350,14 @@
clock-output-names = "usb_ohci0", "usb_phy";
};
mbus_clk: clk@01c2015c {
#clock-cells = <0>;
compatible = "allwinner,sun5i-a13-mbus-clk";
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 12d9ffd..400e696 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -468,6 +468,14 @@
+@@ -464,6 +464,14 @@
clock-output-names = "spi3";
};
arch/arm/boot/dts/sun7i-a20.dtsi | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 400e696..a0d18b2 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -450,6 +450,29 @@
+@@ -447,6 +447,29 @@
clock-output-names = "ir1";
};
+ };
usb_clk: clk@01c200cc {
#clock-cells = <1>;
- #reset-cells = <1>;
-@@ -468,6 +491,22 @@
+ #reset-cells = <1>;
+@@ -464,6 +487,22 @@
clock-output-names = "spi3";
};
arch/arm/boot/dts/sun7i-a20.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index a0d18b2..1cced70 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -470,7 +470,7 @@
+@@ -467,7 +467,7 @@
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-mod1-clk";
reg = <0x01c200c0 0x4>;
create mode 100644 sound/soc/sunxi/Makefile
create mode 100644 sound/soc/sunxi/sunxi-codec.c
-diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
-index 3ba52da..87dbf48 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -53,6 +53,7 @@ source "sound/soc/samsung/Kconfig"
source "sound/soc/tegra/Kconfig"
source "sound/soc/txx9/Kconfig"
source "sound/soc/ux500/Kconfig"
-diff --git a/sound/soc/Makefile b/sound/soc/Makefile
-index 974ba70..39011b8 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_SND_SOC) += samsung/
obj-$(CONFIG_SND_SOC) += tegra/
obj-$(CONFIG_SND_SOC) += txx9/
obj-$(CONFIG_SND_SOC) += ux500/
-diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
-new file mode 100644
-index 0000000..79511ae
--- /dev/null
+++ b/sound/soc/sunxi/Kconfig
@@ -0,0 +1,10 @@
+ default y
+
+endmenu
-diff --git a/sound/soc/sunxi/Makefile b/sound/soc/sunxi/Makefile
-new file mode 100644
-index 0000000..b8950d3
--- /dev/null
+++ b/sound/soc/sunxi/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_SND_SUNXI_SOC_CODEC) += sunxi-codec.o
+
-diff --git a/sound/soc/sunxi/sunxi-codec.c b/sound/soc/sunxi/sunxi-codec.c
-new file mode 100644
-index 0000000..67f978e
--- /dev/null
+++ b/sound/soc/sunxi/sunxi-codec.c
@@ -0,0 +1,802 @@
sound/soc/sunxi/sunxi-codec.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
-diff --git a/sound/soc/sunxi/sunxi-codec.c b/sound/soc/sunxi/sunxi-codec.c
-index 67f978e..77a191b 100644
--- a/sound/soc/sunxi/sunxi-codec.c
+++ b/sound/soc/sunxi/sunxi-codec.c
-@@ -215,9 +215,6 @@ static int sunxi_codec_prepare(struct snd_pcm_substream *substream,
+@@ -215,9 +215,6 @@ static int sunxi_codec_prepare(struct sn
regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 0x1 << SUNXI_DAC_FIFOC_FIR_VERSION, 0x1 << SUNXI_DAC_FIFOC_FIR_VERSION);
}
/* send last sample when DAC FIFO under run */
regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 0x1 << SUNXI_DAC_FIFOC_SEND_LASAT, 0x0 << SUNXI_DAC_FIFOC_SEND_LASAT);
} else {
-@@ -329,6 +326,7 @@ static int sunxi_codec_hw_params(struct snd_pcm_substream *substream,
+@@ -329,6 +326,7 @@ static int sunxi_codec_hw_params(struct
regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 7 << SUNXI_DAC_FIFOC_DAC_FS, hwrate << SUNXI_DAC_FIFOC_DAC_FS);
regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 1 << SUNXI_DAC_FIFOC_MONO_EN, is_mono << SUNXI_DAC_FIFOC_MONO_EN);
regmap_update_bits(priv->regmap, SUNXI_DAC_FIFOC, 1 << SUNXI_DAC_FIFOC_TX_SAMPLE_BITS, is_24bit << SUNXI_DAC_FIFOC_TX_SAMPLE_BITS);
arch/arm/boot/dts/sun7i-a20.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
-diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
-index 1cced70..a99bbae 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -1214,6 +1214,18 @@
+@@ -1182,6 +1182,18 @@
status = "disabled";
};
-diff -ruN old/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts new/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
---- old/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts 2015-07-10 18:50:06.000000000 +0200
-+++ new/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts 2015-08-02 11:45:06.000000000 +0200
-@@ -245,3 +245,10 @@
+--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
++++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
+@@ -302,3 +302,10 @@
};
};
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 7 +++++++
1 file changed, 7 insertions(+)
-diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
-index 39a51d5..5f9f0b9 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
-@@ -84,6 +84,13 @@
- status = "okay";
- };
+@@ -180,6 +180,13 @@
+
+ #include "axp209.dtsi"
+&codec {
+ routing =
arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 7 +++++++
1 file changed, 7 insertions(+)
-diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
-index 4611e2f..d05e06d 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
-@@ -105,6 +105,13 @@
- status = "okay";
- };
+@@ -257,6 +257,13 @@
+
+ #include "axp209.dtsi"
+&codec {
+ routing =
create mode 100644 Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt
create mode 100644 drivers/usb/musb/sunxi.c
-diff --git a/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt b/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt
-new file mode 100644
-index 0000000..9254a6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt
@@ -0,0 +1,27 @@
+ extcon = <&usbphy 0>;
+ status = "disabled";
+ };
-diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
-index 39db8b6..37081ed 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -5,7 +5,7 @@
config USB_MUSB_DAVINCI
tristate "DaVinci"
depends on ARCH_DAVINCI_DMx
-diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
-index ba49501..f95befe 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
-@@ -20,6 +20,7 @@ obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
+@@ -20,6 +20,7 @@ obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.
obj-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o
obj-$(CONFIG_USB_MUSB_UX500) += ux500.o
obj-$(CONFIG_USB_MUSB_JZ4740) += jz4740.o
obj-$(CONFIG_USB_MUSB_AM335X_CHILD) += musb_am335x.o
-diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
-new file mode 100644
-index 0000000..00d7248
--- /dev/null
+++ b/drivers/usb/musb/sunxi.c
@@ -0,0 +1,703 @@
drivers/usb/musb/sunxi.c | 50 +++++++++++++++++++---
2 files changed, 46 insertions(+), 7 deletions(-)
-diff --git a/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt b/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt
-index 9254a6c..fde180b 100644
--- a/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt
+++ b/Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.txt
-@@ -2,9 +2,10 @@ Allwinner sun4i A10 musb DRC/OTG controller
+@@ -2,9 +2,10 @@ Allwinner sun4i A10 musb DRC/OTG control
-------------------------------------------
Required properties:
- interrupts : interrupt to which the musb controller is connected
- interrupt-names : must be "mc"
- phys : phy specifier for the otg phy
-diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
-index 00d7248..df2f75e 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -26,6 +26,7 @@
struct phy *phy;
struct platform_device *usb_phy;
struct usb_phy *xceiv;
-@@ -229,14 +233,22 @@ static int sunxi_musb_init(struct musb *musb)
+@@ -229,14 +233,22 @@ static int sunxi_musb_init(struct musb *
musb->phy = glue->phy;
musb->xceiv = glue->xceiv;
writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0);
/* Register notifier before calling phy_init() */
-@@ -244,7 +256,7 @@ static int sunxi_musb_init(struct musb *musb)
+@@ -244,7 +256,7 @@ static int sunxi_musb_init(struct musb *
ret = extcon_register_notifier(glue->extcon, EXTCON_USB_HOST,
&glue->host_nb);
if (ret)
}
ret = phy_init(glue->phy);
-@@ -273,10 +285,14 @@ static int sunxi_musb_init(struct musb *musb)
+@@ -273,10 +285,14 @@ error_unregister_notifier:
if (musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE)
extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
&glue->host_nb);
return ret;
}
-@@ -296,8 +312,12 @@ static int sunxi_musb_exit(struct musb *musb)
+@@ -296,8 +312,12 @@ static int sunxi_musb_exit(struct musb *
extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
&glue->host_nb);
return 0;
}
-@@ -617,6 +637,12 @@ static int sunxi_musb_probe(struct platform_device *pdev)
+@@ -617,6 +637,12 @@ static int sunxi_musb_probe(struct platf
INIT_WORK(&glue->work, sunxi_musb_work);
glue->host_nb.notifier_call = sunxi_musb_host_notifier;
glue->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(glue->clk)) {
dev_err(&pdev->dev, "Error getting clock: %ld\n",
-@@ -624,6 +650,17 @@ static int sunxi_musb_probe(struct platform_device *pdev)
+@@ -624,6 +650,17 @@ static int sunxi_musb_probe(struct platf
return PTR_ERR(glue->clk);
}
glue->phy = devm_phy_get(&pdev->dev, "usb");
if (IS_ERR(glue->phy)) {
if (PTR_ERR(glue->phy) == -EPROBE_DEFER)
-@@ -685,6 +722,7 @@ static int sunxi_musb_remove(struct platform_device *pdev)
+@@ -685,6 +722,7 @@ static int sunxi_musb_remove(struct plat
static const struct of_device_id sunxi_musb_match[] = {
{ .compatible = "allwinner,sun4i-a10-musb", },
-Index: linux-4.1.3/arch/arm/boot/dts/sun7i-a20.dtsi
-===================================================================
---- linux-4.1.3.orig/arch/arm/boot/dts/sun7i-a20.dtsi
-+++ linux-4.1.3/arch/arm/boot/dts/sun7i-a20.dtsi
-@@ -679,6 +679,14 @@
+--- a/arch/arm/boot/dts/sun7i-a20.dtsi
++++ b/arch/arm/boot/dts/sun7i-a20.dtsi
+@@ -745,6 +745,14 @@
status = "disabled";
};
arch/arm/boot/dts/sun4i-a10.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
-diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
-index 61c03d1..551e3d1 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
-@@ -643,6 +643,14 @@
+@@ -591,6 +591,14 @@
status = "disabled";
};
create mode 100644 drivers/crypto/sunxi-ss/sun4i-ss-hash.c
create mode 100644 drivers/crypto/sunxi-ss/sun4i-ss.h
-diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
-index 4044125..07bc7aa 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
-@@ -480,4 +480,21 @@ config CRYPTO_DEV_IMGTEC_HASH
+@@ -460,4 +460,21 @@ config CRYPTO_DEV_IMGTEC_HASH
hardware hash accelerator. Supporting MD5/SHA1/SHA224/SHA256
hashing algorithms.
+ will be called sun4i-ss.
+
endif # CRYPTO_HW
-diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
-index e35c07a..c3ced6f 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
-@@ -28,3 +28,4 @@ obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/
+@@ -27,3 +27,4 @@ obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/
obj-$(CONFIG_CRYPTO_DEV_QAT) += qat/
obj-$(CONFIG_CRYPTO_DEV_QCE) += qce/
obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
+obj-$(CONFIG_CRYPTO_DEV_SUN4I_SS) += sunxi-ss/
-diff --git a/drivers/crypto/sunxi-ss/Makefile b/drivers/crypto/sunxi-ss/Makefile
-new file mode 100644
-index 0000000..8f4c7a2
--- /dev/null
+++ b/drivers/crypto/sunxi-ss/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_CRYPTO_DEV_SUN4I_SS) += sun4i-ss.o
+sun4i-ss-y += sun4i-ss-core.o sun4i-ss-hash.o sun4i-ss-cipher.o
-diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-new file mode 100644
-index 0000000..e070c31
--- /dev/null
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
@@ -0,0 +1,542 @@
+ memcpy(op->key, key, keylen);
+ return 0;
+}
-diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
-new file mode 100644
-index 0000000..0b79b58
--- /dev/null
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
@@ -0,0 +1,403 @@
+MODULE_DESCRIPTION("Allwinner Security System cryptographic accelerator");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Corentin LABBE <clabbe.montjoie@gmail.com>");
-diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
-new file mode 100644
-index 0000000..ff80314
--- /dev/null
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
@@ -0,0 +1,492 @@
+
+ return sun4i_hash_final(areq);
+}
-diff --git a/drivers/crypto/sunxi-ss/sun4i-ss.h b/drivers/crypto/sunxi-ss/sun4i-ss.h
-new file mode 100644
-index 0000000..db18b255
--- /dev/null
+++ b/drivers/crypto/sunxi-ss/sun4i-ss.h
@@ -0,0 +1,199 @@
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts | 11 +++++++++++
2 files changed, 22 insertions(+)
-Index: linux-4.1.3/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
-===================================================================
---- linux-4.1.3.orig/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
-+++ linux-4.1.3/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
++++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
@@ -71,12 +71,23 @@
};
};
usbphy: phy@01c13400 {
-Index: linux-4.1.3/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
-===================================================================
---- linux-4.1.3.orig/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
-+++ linux-4.1.3/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
+--- a/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
++++ b/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
@@ -69,12 +69,23 @@
};
arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 36 ++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
-Index: linux-4.1.3/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
-===================================================================
---- linux-4.1.3.orig/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
-+++ linux-4.1.3/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
++++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
@@ -88,6 +88,20 @@
interrupts = <10 8>; /* PH10 / EINT10 */
interrupt-names = "host-wake";
-Index: linux-4.1.3/arch/arm/boot/dts/Makefile
-===================================================================
---- linux-4.1.3.orig/arch/arm/boot/dts/Makefile
-+++ linux-4.1.3/arch/arm/boot/dts/Makefile
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
@@ -554,6 +554,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
sun7i-a20-cubietruck.dtb \
sun7i-a20-hummingbird.dtb \
sun7i-a20-m3.dtb \
sun7i-a20-olinuxino-lime.dtb \
sun7i-a20-olinuxino-lime2.dtb \
-Index: linux-4.1.3/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
-===================================================================
--- /dev/null
-+++ linux-4.1.3/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
++++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2015 Daniel Golle <daniel@makrotopia.org>