Commit c2e1da63 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'omap-for-v3.17/fixes-against-rc2' of...

Merge tag 'omap-for-v3.17/fixes-against-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Merge "omap fixes against v3.17-rc2" from Tony Lindgren:

Fixes for omaps, mostly to revert NAND back to using software ECC
by default as that's what many boards expect. Also fixes for omap5
clocks, PM wake-up events, GPIO interrupt cells for dra7, and few
other minor fixes.

* tag 'omap-for-v3.17/fixes-against-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: dts: omap54xx-clocks: Fix the l3 and l4 clock rates
  ARM: OMAP2+: hwmod: Rearm wake-up interrupts for DT when MUSB is idled
  ARM: dts: Enable UART wake-up events for beagleboard
  ARM: dts: Remove twl6030 clk32g "regulator"
  ARM: OMAP2+: omap_device: remove warning that clk alias already exists
  ARM: OMAP: fix %d confusingly prefixed with 0x in format string
  ARM: dts: DRA7: fix interrupt-cells for GPIO
  mtd: nand: omap: Fix 1-bit Hamming code scheme, omap_calculate_ecc()
  ARM: dts: omap3430-sdp: Revert to using software ECC for NAND
  ARM: OMAP2+: GPMC: Support Software ECC scheme via DT
  mtd: nand: omap: Revert to using software ECC by default
parents 541555e9 8fd46439
...@@ -22,7 +22,7 @@ Optional properties: ...@@ -22,7 +22,7 @@ Optional properties:
width of 8 is assumed. width of 8 is assumed.
- ti,nand-ecc-opt: A string setting the ECC layout to use. One of: - ti,nand-ecc-opt: A string setting the ECC layout to use. One of:
"sw" <deprecated> use "ham1" instead "sw" 1-bit Hamming ecc code via software
"hw" <deprecated> use "ham1" instead "hw" <deprecated> use "ham1" instead
"hw-romcode" <deprecated> use "ham1" instead "hw-romcode" <deprecated> use "ham1" instead
"ham1" 1-bit Hamming ecc code "ham1" 1-bit Hamming ecc code
......
...@@ -245,7 +245,7 @@ gpio1: gpio@4ae10000 { ...@@ -245,7 +245,7 @@ gpio1: gpio@4ae10000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio2: gpio@48055000 { gpio2: gpio@48055000 {
...@@ -256,7 +256,7 @@ gpio2: gpio@48055000 { ...@@ -256,7 +256,7 @@ gpio2: gpio@48055000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio3: gpio@48057000 { gpio3: gpio@48057000 {
...@@ -267,7 +267,7 @@ gpio3: gpio@48057000 { ...@@ -267,7 +267,7 @@ gpio3: gpio@48057000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio4: gpio@48059000 { gpio4: gpio@48059000 {
...@@ -278,7 +278,7 @@ gpio4: gpio@48059000 { ...@@ -278,7 +278,7 @@ gpio4: gpio@48059000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio5: gpio@4805b000 { gpio5: gpio@4805b000 {
...@@ -289,7 +289,7 @@ gpio5: gpio@4805b000 { ...@@ -289,7 +289,7 @@ gpio5: gpio@4805b000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio6: gpio@4805d000 { gpio6: gpio@4805d000 {
...@@ -300,7 +300,7 @@ gpio6: gpio@4805d000 { ...@@ -300,7 +300,7 @@ gpio6: gpio@4805d000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio7: gpio@48051000 { gpio7: gpio@48051000 {
...@@ -311,7 +311,7 @@ gpio7: gpio@48051000 { ...@@ -311,7 +311,7 @@ gpio7: gpio@48051000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
gpio8: gpio@48053000 { gpio8: gpio@48053000 {
...@@ -322,7 +322,7 @@ gpio8: gpio@48053000 { ...@@ -322,7 +322,7 @@ gpio8: gpio@48053000 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <1>; #interrupt-cells = <2>;
}; };
uart1: serial@4806a000 { uart1: serial@4806a000 {
......
...@@ -292,6 +292,7 @@ &twl_gpio { ...@@ -292,6 +292,7 @@ &twl_gpio {
&uart3 { &uart3 {
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&uart3_pins>; pinctrl-0 = <&uart3_pins>;
interrupts-extended = <&intc 74 &omap3_pmx_core OMAP3_UART3_RX>;
}; };
&gpio1 { &gpio1 {
......
...@@ -107,7 +107,7 @@ nand@1,0 { ...@@ -107,7 +107,7 @@ nand@1,0 {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
reg = <1 0 0x08000000>; reg = <1 0 0x08000000>;
ti,nand-ecc-opt = "ham1"; ti,nand-ecc-opt = "sw";
nand-bus-width = <8>; nand-bus-width = <8>;
gpmc,cs-on-ns = <0>; gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <36>; gpmc,cs-rd-off-ns = <36>;
......
...@@ -367,10 +367,12 @@ usb_dpll_hs_clk_div: usb_dpll_hs_clk_div { ...@@ -367,10 +367,12 @@ usb_dpll_hs_clk_div: usb_dpll_hs_clk_div {
l3_iclk_div: l3_iclk_div { l3_iclk_div: l3_iclk_div {
#clock-cells = <0>; #clock-cells = <0>;
compatible = "fixed-factor-clock"; compatible = "ti,divider-clock";
ti,max-div = <2>;
ti,bit-shift = <4>;
reg = <0x100>;
clocks = <&dpll_core_h12x2_ck>; clocks = <&dpll_core_h12x2_ck>;
clock-mult = <1>; ti,index-power-of-two;
clock-div = <1>;
}; };
gpu_l3_iclk: gpu_l3_iclk { gpu_l3_iclk: gpu_l3_iclk {
...@@ -383,10 +385,12 @@ gpu_l3_iclk: gpu_l3_iclk { ...@@ -383,10 +385,12 @@ gpu_l3_iclk: gpu_l3_iclk {
l4_root_clk_div: l4_root_clk_div { l4_root_clk_div: l4_root_clk_div {
#clock-cells = <0>; #clock-cells = <0>;
compatible = "fixed-factor-clock"; compatible = "ti,divider-clock";
ti,max-div = <2>;
ti,bit-shift = <8>;
reg = <0x100>;
clocks = <&l3_iclk_div>; clocks = <&l3_iclk_div>;
clock-mult = <1>; ti,index-power-of-two;
clock-div = <1>;
}; };
slimbus1_slimbus_clk: slimbus1_slimbus_clk { slimbus1_slimbus_clk: slimbus1_slimbus_clk {
......
...@@ -83,10 +83,6 @@ v2v1: regulator-v2v1 { ...@@ -83,10 +83,6 @@ v2v1: regulator-v2v1 {
regulator-always-on; regulator-always-on;
}; };
clk32kg: regulator-clk32kg {
compatible = "ti,twl6030-clk32kg";
};
twl_usb_comparator: usb-comparator { twl_usb_comparator: usb-comparator {
compatible = "ti,twl6030-usb"; compatible = "ti,twl6030-usb";
interrupts = <4>, <10>; interrupts = <4>, <10>;
......
...@@ -142,7 +142,7 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, ...@@ -142,7 +142,7 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs,
board_nand_data.nr_parts = nr_parts; board_nand_data.nr_parts = nr_parts;
board_nand_data.devsize = nand_type; board_nand_data.devsize = nand_type;
board_nand_data.ecc_opt = OMAP_ECC_HAM1_CODE_HW; board_nand_data.ecc_opt = OMAP_ECC_HAM1_CODE_SW;
gpmc_nand_init(&board_nand_data, gpmc_t); gpmc_nand_init(&board_nand_data, gpmc_t);
} }
#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
......
...@@ -49,7 +49,8 @@ static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) ...@@ -49,7 +49,8 @@ static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
return 0; return 0;
/* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */ /* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */
if (ecc_opt == OMAP_ECC_HAM1_CODE_HW) if (ecc_opt == OMAP_ECC_HAM1_CODE_HW ||
ecc_opt == OMAP_ECC_HAM1_CODE_SW)
return 1; return 1;
else else
return 0; return 0;
......
...@@ -1403,8 +1403,11 @@ static int gpmc_probe_nand_child(struct platform_device *pdev, ...@@ -1403,8 +1403,11 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
pr_err("%s: ti,nand-ecc-opt not found\n", __func__); pr_err("%s: ti,nand-ecc-opt not found\n", __func__);
return -ENODEV; return -ENODEV;
} }
if (!strcmp(s, "ham1") || !strcmp(s, "sw") ||
!strcmp(s, "hw") || !strcmp(s, "hw-romcode")) if (!strcmp(s, "sw"))
gpmc_nand_data->ecc_opt = OMAP_ECC_HAM1_CODE_SW;
else if (!strcmp(s, "ham1") ||
!strcmp(s, "hw") || !strcmp(s, "hw-romcode"))
gpmc_nand_data->ecc_opt = gpmc_nand_data->ecc_opt =
OMAP_ECC_HAM1_CODE_HW; OMAP_ECC_HAM1_CODE_HW;
else if (!strcmp(s, "bch4")) else if (!strcmp(s, "bch4"))
......
...@@ -663,7 +663,7 @@ void __init dra7xxx_check_revision(void) ...@@ -663,7 +663,7 @@ void __init dra7xxx_check_revision(void)
default: default:
/* Unknown default to latest silicon rev as default*/ /* Unknown default to latest silicon rev as default*/
pr_warn("%s: unknown idcode=0x%08x (hawkeye=0x%08x,rev=0x%d)\n", pr_warn("%s: unknown idcode=0x%08x (hawkeye=0x%08x,rev=0x%x)\n",
__func__, idcode, hawkeye, rev); __func__, idcode, hawkeye, rev);
omap_revision = DRA752_REV_ES1_1; omap_revision = DRA752_REV_ES1_1;
} }
......
...@@ -56,7 +56,7 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, ...@@ -56,7 +56,7 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias); r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias);
if (!IS_ERR(r)) { if (!IS_ERR(r)) {
dev_warn(&od->pdev->dev, dev_dbg(&od->pdev->dev,
"alias %s already exists\n", clk_alias); "alias %s already exists\n", clk_alias);
clk_put(r); clk_put(r);
return; return;
......
...@@ -2185,6 +2185,8 @@ static int _enable(struct omap_hwmod *oh) ...@@ -2185,6 +2185,8 @@ static int _enable(struct omap_hwmod *oh)
oh->mux->pads_dynamic))) { oh->mux->pads_dynamic))) {
omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED); omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
_reconfigure_io_chain(); _reconfigure_io_chain();
} else if (oh->flags & HWMOD_FORCE_MSTANDBY) {
_reconfigure_io_chain();
} }
_add_initiator_dep(oh, mpu_oh); _add_initiator_dep(oh, mpu_oh);
...@@ -2291,6 +2293,8 @@ static int _idle(struct omap_hwmod *oh) ...@@ -2291,6 +2293,8 @@ static int _idle(struct omap_hwmod *oh)
if (oh->mux && oh->mux->pads_dynamic) { if (oh->mux && oh->mux->pads_dynamic) {
omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE); omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE);
_reconfigure_io_chain(); _reconfigure_io_chain();
} else if (oh->flags & HWMOD_FORCE_MSTANDBY) {
_reconfigure_io_chain();
} }
oh->_state = _HWMOD_STATE_IDLE; oh->_state = _HWMOD_STATE_IDLE;
......
...@@ -931,7 +931,7 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat, ...@@ -931,7 +931,7 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
u32 val; u32 val;
val = readl(info->reg.gpmc_ecc_config); val = readl(info->reg.gpmc_ecc_config);
if (((val >> ECC_CONFIG_CS_SHIFT) & ~CS_MASK) != info->gpmc_cs) if (((val >> ECC_CONFIG_CS_SHIFT) & CS_MASK) != info->gpmc_cs)
return -EINVAL; return -EINVAL;
/* read ecc result */ /* read ecc result */
...@@ -1794,9 +1794,12 @@ static int omap_nand_probe(struct platform_device *pdev) ...@@ -1794,9 +1794,12 @@ static int omap_nand_probe(struct platform_device *pdev)
} }
/* populate MTD interface based on ECC scheme */ /* populate MTD interface based on ECC scheme */
nand_chip->ecc.layout = &omap_oobinfo;
ecclayout = &omap_oobinfo; ecclayout = &omap_oobinfo;
switch (info->ecc_opt) { switch (info->ecc_opt) {
case OMAP_ECC_HAM1_CODE_SW:
nand_chip->ecc.mode = NAND_ECC_SOFT;
break;
case OMAP_ECC_HAM1_CODE_HW: case OMAP_ECC_HAM1_CODE_HW:
pr_info("nand: using OMAP_ECC_HAM1_CODE_HW\n"); pr_info("nand: using OMAP_ECC_HAM1_CODE_HW\n");
nand_chip->ecc.mode = NAND_ECC_HW; nand_chip->ecc.mode = NAND_ECC_HW;
...@@ -1848,7 +1851,7 @@ static int omap_nand_probe(struct platform_device *pdev) ...@@ -1848,7 +1851,7 @@ static int omap_nand_probe(struct platform_device *pdev)
nand_chip->ecc.priv = nand_bch_init(mtd, nand_chip->ecc.priv = nand_bch_init(mtd,
nand_chip->ecc.size, nand_chip->ecc.size,
nand_chip->ecc.bytes, nand_chip->ecc.bytes,
&nand_chip->ecc.layout); &ecclayout);
if (!nand_chip->ecc.priv) { if (!nand_chip->ecc.priv) {
pr_err("nand: error: unable to use s/w BCH library\n"); pr_err("nand: error: unable to use s/w BCH library\n");
err = -EINVAL; err = -EINVAL;
...@@ -1923,7 +1926,7 @@ static int omap_nand_probe(struct platform_device *pdev) ...@@ -1923,7 +1926,7 @@ static int omap_nand_probe(struct platform_device *pdev)
nand_chip->ecc.priv = nand_bch_init(mtd, nand_chip->ecc.priv = nand_bch_init(mtd,
nand_chip->ecc.size, nand_chip->ecc.size,
nand_chip->ecc.bytes, nand_chip->ecc.bytes,
&nand_chip->ecc.layout); &ecclayout);
if (!nand_chip->ecc.priv) { if (!nand_chip->ecc.priv) {
pr_err("nand: error: unable to use s/w BCH library\n"); pr_err("nand: error: unable to use s/w BCH library\n");
err = -EINVAL; err = -EINVAL;
...@@ -2012,6 +2015,9 @@ static int omap_nand_probe(struct platform_device *pdev) ...@@ -2012,6 +2015,9 @@ static int omap_nand_probe(struct platform_device *pdev)
goto return_error; goto return_error;
} }
if (info->ecc_opt == OMAP_ECC_HAM1_CODE_SW)
goto scan_tail;
/* all OOB bytes from oobfree->offset till end off OOB are free */ /* all OOB bytes from oobfree->offset till end off OOB are free */
ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset; ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset;
/* check if NAND device's OOB is enough to store ECC signatures */ /* check if NAND device's OOB is enough to store ECC signatures */
...@@ -2021,7 +2027,9 @@ static int omap_nand_probe(struct platform_device *pdev) ...@@ -2021,7 +2027,9 @@ static int omap_nand_probe(struct platform_device *pdev)
err = -EINVAL; err = -EINVAL;
goto return_error; goto return_error;
} }
nand_chip->ecc.layout = ecclayout;
scan_tail:
/* second phase scan */ /* second phase scan */
if (nand_scan_tail(mtd)) { if (nand_scan_tail(mtd)) {
err = -ENXIO; err = -ENXIO;
......
...@@ -21,8 +21,17 @@ enum nand_io { ...@@ -21,8 +21,17 @@ enum nand_io {
}; };
enum omap_ecc { enum omap_ecc {
/* 1-bit ECC calculation by GPMC, Error detection by Software */ /*
OMAP_ECC_HAM1_CODE_HW = 0, * 1-bit ECC: calculation and correction by SW
* ECC stored at end of spare area
*/
OMAP_ECC_HAM1_CODE_SW = 0,
/*
* 1-bit ECC: calculation by GPMC, Error detection by Software
* ECC layout compatible with ROM code layout
*/
OMAP_ECC_HAM1_CODE_HW,
/* 4-bit ECC calculation by GPMC, Error detection by Software */ /* 4-bit ECC calculation by GPMC, Error detection by Software */
OMAP_ECC_BCH4_CODE_HW_DETECTION_SW, OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
/* 4-bit ECC calculation by GPMC, Error detection by ELM */ /* 4-bit ECC calculation by GPMC, Error detection by ELM */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment