Commit Graph

42 Commits (dcc34574efba524cf75608c3b61bfa579bfb8aa4)

Author SHA1 Message Date
Daniel Golle dcc34574ef oxnas: bring in new oxnas target
Reboot the oxnas target based on Linux 4.14 by rebasing our support on
top of the now-existing upstream kernel support.
This commit brings oxnas support to the level of v4.17 having upstream
drivers for Ethernet, Serial and NAND flash.
Botch up OpenWrt's local drivers for EHCI, SATA and PCIe based on the
new platform code and device-tree.
Re-introduce base-files from old oxnas target which works for now but
needs further clean-up towards generic board support.

Functional issues:
 * PCIe won't come up (hence no USB3 on Shuttle KD20)
 * I2C bus of Akitio myCloud device is likely not to work (missing
   debounce support in new pinctrl driver)

Code-style issues:
 * plla/pllb needs further cleanup -- currently their users or writing
   into the syscon regmap after acquireling the clk instead of using
   defined clk_*_*() functions to setup multipliers and dividors.
 * PCIe phy needs its own little driver.
 * SATA driver is a monster and should be split into an mfd having
   a raidctrl regmap, sata controller, sata ports and sata phy.

Tested on MitraStar STG-212 aka. Medion Akoya MD86xxx and Shuttle KD20.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Daniel Golle 17511a7ea8 oxnas: kill old oxnas target
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Daniel Golle 870b7bee44 oxnas: remove some kprintf calls from NAND driver
They were added for debugging and I forgot to remove them.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Daniel Golle a46c9a4038 oxnas: remove support for pre-4.4 kernels from drivers
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Hauke Mehrtens 321aca6661 oxnas: fix syntax in ox820-akitio.dts
This commit introduced a syntax error in ox820-akitio.dts which is
fixed now:
commit 5cde94d9ab
Author: Daniel Golle <daniel@makrotopia.org>
Date:   Sat Sep 24 01:14:53 2016 +0200
    oxnas: backport upstream NAND driver

This caused the folowing error message in the build bot:
Error: arch/arm/boot/dts/ox820-akitio.dts:146.3-147.1 syntax error
FATAL ERROR: Unable to parse input tree
scripts/Makefile.lib:293: recipe for target 'arch/arm/boot/dts/ox820-akitio.dtb' failed
make[5]: *** [arch/arm/boot/dts/ox820-akitio.dtb] Error 1

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Daniel Golle 5cde94d9ab oxnas: backport upstream NAND driver
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Mathias Kresin 2b55c83e68 treewide: dts: use keycode defines from input dt-binding
All compiled device tree files not mentioned are binary identical to the
former ones.

Fix the obvious decimal/hex confusion for the power key of ramips/M2M.dts.

Due to the include of the input binding header, the BTN_* node names in:

  - ramips/GL-MT300A.dts
  - ramips/GL-MT300N.dts
  - ramips/GL-MT750.dts
  - ramips/Timecloud.dts

will be changed by the compiler to the numerical equivalent.

Move the binding include of lantiq boards to the file where they are
used the first time to hint the user where the values do come from.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 77b807999d treewide: dts: use C style includes
No functional change but allows me to use one script to compile all
device tree source files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Daniel Golle a810e7789a oxnas: add mem=128M to stg-212 built-in cmdline for legacy u-boot
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Daniel Golle c773a2c46e oxnas: kd20: generate image compatible with stock firmware
* adjust MTD partitions to match vendor's scheme
 * generate *factory.tar.gz image compatible with stock web-if
   firmware upgrade interface

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Daniel Golle c5ec5e1f7f oxnas: revert to kernel 4.1
A bug resulting in the NAND not being detected by newer kernels has
kept me sleepless for months and yet I wasn't able to discover the
cause.
Bring back patches and files for 4.1 until this has been resolved.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Daniel Golle 118b5ae7b2 oxnas: drop compatibility with old kernels from mach-ox820
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Daniel Golle 97ce23c347 oxnas: drop compatibility with old kernels from pinctrl
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Daniel Golle f90f379a7f oxnas: drop compatibility with old kernels from irq-rps
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Daniel Golle 53a9809080 oxnas: drop compatibility with old kernels from dwmac-oxnas
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Luka Perkov 9f4e0c7751 oxnas: add missing semicolon
A missing semicolon in the gpio-keys-polled section of ox820-akitio.dts
caused the build to break. Add it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 49219
8 years ago
Hauke Mehrtens 012da658a4 oxnas: add support for Akitio MyCloud mini
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 49197
8 years ago
John Crispin e9db6eb8b2 oxnas: sync cpu-hotplug with mach-realview
Make mach-oxnas/hotplug.c look more similar to mach-realview/hotplug.c,
just cosmetics and maintainability concerns, no functional changes.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 49044
8 years ago
John Crispin b64f159bc8 oxnas: add spinlock in pinctrl driver
Try to address a race-condition in pinctrl-oxnas.c

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 49043
8 years ago
John Crispin daf7ab04ba oxnas: also reset GPIO B registers on boot
Clear both, SYS_CTRL_*_SEL and SEC_CTRL_*_SEL on boot instead of
writing to SYS_CTRL_*_SEL twice which looks like a copy-paste error.
Thanks to anonymous to bring this up in #21892!

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 49042
8 years ago
John Crispin 300be15e84 oxnas: complete NAND driver clean-up
some bit rot was accidentally left-out in r48986, remove it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 48997
8 years ago
John Crispin 61f27ca3e4 oxnas: clean-up NAND driver to fix probing issue
A re-write of the driver based on xway_nand.c and constants as
well as the cmd_ctrl() function from the original oxnas_nand.c
resulted in a extremely similar looking file (see diffsize),
and fixes the issue of NAND not being detected on newer kernels.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 48986
8 years ago
Felix Fietkau cee6c07cf3 oxnas: prepare platform and drivers for Linux 4.4
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 48338
8 years ago
John Crispin 6944a95091 oxnas: move gmac soc glue from mach to stmmac driver
Still a lot of kernel-version ifdef'ery, but imho that's easy to remove
once obsoleted and avoids duplicate code in the meantime.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 47218
9 years ago
John Crispin 54b8ddf9e7 oxnas: prepare pinctrl for kernel >=4.2
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 47217
9 years ago
John Crispin 26329f650c oxnas: prepare irqchip driver for kernel >=4.2
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 47216
9 years ago
John Crispin 392b93f579 oxnas: fix duplicate include in clk-oxnas
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 47215
9 years ago
John Crispin ec9ffe892f oxnas: remove obsolete __cpuinit
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 47214
9 years ago
John Crispin 7261fde797 oxnas: prepare for kernel 4.1
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 46636
9 years ago
John Crispin 35c52bc261 oxnas: remove pre kernel 3.18 support from pinctrl driver
just some pruning...

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 44923
9 years ago
Felix Fietkau 2ef587a8fc oxnas: clk-oxnas: rework pllb enable function
kernel lock debugging unveiled that we should not call
of_reset_control_get inside a clock's enable operation (see below)

move of_reset_control_* previously used in pllb_clk_enable to new
pllb_clk_prepare and pllb_clk_unprepare functions.
use a container to carry runtime information.

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2742 lockdep_trace_alloc+0xb8/0xfc()
DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.26 #6
[<c001a6ac>] (unwind_backtrace) from [<c0016dec>] (show_stack+0x10/0x14)
[<c0016dec>] (show_stack) from [<c0194f68>] (dump_stack+0x7c/0x94)
[<c0194f68>] (dump_stack) from [<c0021b50>] (warn_slowpath_common+0x68/0x8c)
[<c0021b50>] (warn_slowpath_common) from [<c0021ba4>] (warn_slowpath_fmt+0x30/0x40)
[<c0021ba4>] (warn_slowpath_fmt) from [<c0061b30>] (lockdep_trace_alloc+0xb8/0xfc)
[<c0061b30>] (lockdep_trace_alloc) from [<c00cb740>] (kmem_cache_alloc+0x1c/0xf8)
[<c00cb740>] (kmem_cache_alloc) from [<c01d33c8>] (of_reset_control_get+0xe8/0x12c)
[<c01d33c8>] (of_reset_control_get) from [<c0269228>] (pllb_clk_enable+0x14/0xbc)
[<c0269228>] (pllb_clk_enable) from [<c0265738>] (__clk_enable+0x54/0xa0)
[<c0265738>] (__clk_enable) from [<c0265acc>] (clk_enable+0x18/0x2c)
[<c0265acc>] (clk_enable) from [<c04325f8>] (oxnas_pcie_probe+0x3b8/0x6a0)
[<c04325f8>] (oxnas_pcie_probe) from [<c01f2510>] (platform_drv_probe+0x18/0x48)
[<c01f2510>] (platform_drv_probe) from [<c01f1070>] (driver_probe_device+0xd8/0x24c)
[<c01f1070>] (driver_probe_device) from [<c01f1298>] (__driver_attach+0x70/0x94)
[<c01f1298>] (__driver_attach) from [<c01ef728>] (bus_for_each_dev+0x4c/0x98)
[<c01ef728>] (bus_for_each_dev) from [<c01f0818>] (bus_add_driver+0xcc/0x1e8)
[<c01f0818>] (bus_add_driver) from [<c01f169c>] (driver_register+0xa0/0xe8)
[<c01f169c>] (driver_register) from [<c01f2568>] (platform_driver_probe+0x20/0xa4)
[<c01f2568>] (platform_driver_probe) from [<c0013a3c>] (do_one_initcall+0x90/0x140)
[<c0013a3c>] (do_one_initcall) from [<c0421d38>] (kernel_init_freeable+0x1e4/0x2c0)
[<c0421d38>] (kernel_init_freeable) from [<c000c214>] (kernel_init+0x8/0x104)
[<c000c214>] (kernel_init) from [<c0008768>] (ret_from_fork+0x14/0x2c)
---[ end trace 5f17ed2f61e0683f ]---

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43787
10 years ago
Felix Fietkau 93192e65e8 oxnas: sata_oxnas: make irq handler more readable
safed one level of indention by using 'continue' instead of a
lengthy if-clause.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
v2: use logic-AND instead of '?' operator when checking for hw bug 6320

SVN-Revision: 43768
10 years ago
Felix Fietkau 74a9e1c1b0 oxnas: sata_oxnas: refactoring phase 2
- replaced // comments by /* comments */
 - added line-breaks where needed
 - fixed white-space according to kernel style
 - fixed some obvious spelling mistakes in comments and printks
 - removed some unneeded left-overs imported from vendor code-base
 - replaced printk(...) by libata macros where possible

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43767
10 years ago
Felix Fietkau feda47451f oxnas: sata_oxnas: refactoring phase 1
locking for 2nd port and hwraid was added from vendor's GPL code which
doesn't comply with current kernel coding style.

 - moved all global variables into host_priv
 - renamed locks
 - sanetized acquire() and release() parameter list

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43766
10 years ago
John Crispin 10dbdb28d7 oxnas: fix gpio-fan on kd20
define speed-map and include kmod-hwmon-gpiofan in kd20 profile

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43678
10 years ago
John Crispin 9013a144fd oxnas: also make use of the GPIO poweroff driver
Works great to power-off the kd20 ;)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43677
10 years ago
John Crispin 118534ea39 oxnas: use libata ledtrig support for kd20 hdd leds
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43675
10 years ago
John Crispin 9432cbd577 oxnas: add support for 2nd S-ATA port to sata_oxnas driver
similar to mv_sata, use nr-ports attribute from device tree.
import and adapt locking code from vendor GPL sources.
add dma controller handling, it may be used in future to avoid
full core resets similar to the vendor SDK's "progressive cleanup"
function.

this is still very dirty and aimed to first of all do things
quite exactly like the reference code. and it somehow works.
obviously there is lots of room for improvement :)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43598
10 years ago
John Crispin 1fa7c8587d oxnas: add copyright header to sata_oxnas
sata_oxnas.c is obviously a refactored version of sata_ox820.c
which does contain this header.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43597
10 years ago
John Crispin 46814be2a8 oxnas/kd20: use gpio-beeper
gpio-beeper module was added to the kernel recently.
Make use of it to drive the piezoelectric buzzer of the kd20.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43496
10 years ago
John Crispin aa9141046f oxnas: ehci: rename vendor prefix plxtch to plxtech
it was changed in DTS by commit
oxnas-target: fix typo in OX820 device-tree

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43474
10 years ago
John Crispin 72b58f2eb1 add new target 'oxnas'
This is the oxnas target previously developed at
http://gitorious.org/openwrt-oxnas
Basically, this consolidates the changes and addtionas from
http://github.org/kref/linux-oxnas
into a new OpenWrt hardware target 'oxnas' adding support for
 PLX Technology NAS7820/NAS7821/NAS7825/...
formally known as
 Oxford Semiconductor OXE810SE/OXE815/OX820/...

For now there are 4 supported boards:
Cloud Engines Pogoplug V3 (without PCIe)
 fully supported

Cloud Engines Pogoplug Pro (with PCIe)
 fully supported

MitraStar STG-212
 aka ZyXEL NSA-212,
 aka Medion Akoya P89625 / P89636 / P89626 / P89630,
 aka Medion MD 86407 / MD 86805 / MD 86517 / MD 86587
 fully supported, see http://wiki.openwrt.org/toh/medion/md86587

Shuttle KD-20
 partially supported (S-ATA driver lacks support for 2nd port)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 43388
10 years ago