aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/oxnas/files/drivers/reset/reset-ox820.c
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2018-05-31 17:28:38 +0200
committerDaniel Golle <daniel@makrotopia.org>2018-06-18 18:44:14 +0200
commit6f398aa76248dfdbd1ea31b8ef32431be0f762ee (patch)
treee9c8f6380fdabb0a5e00b6bdd335c9397e93b6ad /target/linux/oxnas/files/drivers/reset/reset-ox820.c
parentd6ee5e462c34a337a1b53994df5581a507e2c342 (diff)
downloadupstream-6f398aa76248dfdbd1ea31b8ef32431be0f762ee.tar.gz
upstream-6f398aa76248dfdbd1ea31b8ef32431be0f762ee.tar.bz2
upstream-6f398aa76248dfdbd1ea31b8ef32431be0f762ee.zip
oxnas: reboot 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 are 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> (squash-picked commit 17511a7ea8 and commit dcc34574ef from master)
Diffstat (limited to 'target/linux/oxnas/files/drivers/reset/reset-ox820.c')
-rw-r--r--target/linux/oxnas/files/drivers/reset/reset-ox820.c107
1 files changed, 0 insertions, 107 deletions
diff --git a/target/linux/oxnas/files/drivers/reset/reset-ox820.c b/target/linux/oxnas/files/drivers/reset/reset-ox820.c
deleted file mode 100644
index 0a28de55f4..0000000000
--- a/target/linux/oxnas/files/drivers/reset/reset-ox820.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/module.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/reset-controller.h>
-#include <linux/slab.h>
-#include <linux/types.h>
-#include <mach/hardware.h>
-
-static int ox820_reset_reset(struct reset_controller_dev *rcdev,
- unsigned long id)
-{
- writel(BIT(id), SYS_CTRL_RST_SET_CTRL);
- writel(BIT(id), SYS_CTRL_RST_CLR_CTRL);
- return 0;
-}
-
-static int ox820_reset_assert(struct reset_controller_dev *rcdev,
- unsigned long id)
-{
- writel(BIT(id), SYS_CTRL_RST_SET_CTRL);
-
- return 0;
-}
-
-static int ox820_reset_deassert(struct reset_controller_dev *rcdev,
- unsigned long id)
-{
- writel(BIT(id), SYS_CTRL_RST_CLR_CTRL);
-
- return 0;
-}
-
-static struct reset_control_ops ox820_reset_ops = {
- .reset = ox820_reset_reset,
- .assert = ox820_reset_assert,
- .deassert = ox820_reset_deassert,
-};
-
-static const struct of_device_id ox820_reset_dt_ids[] = {
- { .compatible = "plxtech,nas782x-reset", },
- { /* sentinel */ },
-};
-MODULE_DEVICE_TABLE(of, ox820_reset_dt_ids);
-
-struct reset_controller_dev rcdev;
-
-static int ox820_reset_probe(struct platform_device *pdev)
-{
- struct reset_controller_dev *rcdev;
-
- rcdev = devm_kzalloc(&pdev->dev, sizeof(*rcdev), GFP_KERNEL);
- if (!rcdev)
- return -ENOMEM;
-
- /* note: reset controller is statically mapped */
-
- rcdev->owner = THIS_MODULE;
- rcdev->nr_resets = 32;
- rcdev->ops = &ox820_reset_ops;
- rcdev->of_node = pdev->dev.of_node;
- reset_controller_register(rcdev);
- platform_set_drvdata(pdev, rcdev);
-
- return 0;
-}
-
-static int ox820_reset_remove(struct platform_device *pdev)
-{
- struct reset_controller_dev *rcdev = platform_get_drvdata(pdev);
-
- reset_controller_unregister(rcdev);
-
- return 0;
-}
-
-static struct platform_driver ox820_reset_driver = {
- .probe = ox820_reset_probe,
- .remove = ox820_reset_remove,
- .driver = {
- .name = "ox820-reset",
- .owner = THIS_MODULE,
- .of_match_table = ox820_reset_dt_ids,
- },
-};
-
-static int __init ox820_reset_init(void)
-{
- return platform_driver_probe(&ox820_reset_driver,
- ox820_reset_probe);
-}
-/*
- * reset controller does not support probe deferral, so it has to be
- * initialized before any user, in particular, PCIE uses subsys_initcall.
- */
-arch_initcall(ox820_reset_init);
-
-MODULE_AUTHOR("Ma Haijun");
-MODULE_LICENSE("GPL");