mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 23:42:43 +00:00
4f74957584
This adds the patches to get fairly complete Gemini support using kernel v4.14. It is mainly a backport of patches from kernel v4.16 with omissions of things like graphics that require substantial changes and will be better handled once we move to the v4.16 kernel proper. On top of this are some WIP patches for USB support. Tested on Raidsonic NAS4220B and D-link DNS-313. ChangeLog v4->v5: - Fix ethernet single gmac usecase - Fix USB reset (patch from Hans) - Fix Raidsonic ethernet skew delay - Fix kernel config (bridge, squashfs, jffs2, usb) - Disable second usb port on Raidsonic board until fotg210_hcd is fixed ChangeLog v3->v4: - Make sure to use tabs rather than spaces in base-files. - Use the dns313 image tool from the firmware-utils. - Break out the addition of the v4.14 patches and the removal of the v4.4 patches to separate (big) patches. ChangeLog v2->v3: - Update the kernel config as indicated by Hauke Martens: - Regenerate again after rebasing using kernel_oldconfig dropping a few optimization settings that are now generic - Drop CFG80211 stuff (module) - Drop CIFS stuff (module) - Drop MAC80211 (module) - Drop wireless drivers (module) - Enabled OverlayFS - Added proper DNS-313 boot image generation with the special file header tool. - Disable CMA in the kernel - Enable LZMA compression of the kernel - Consequently name the nas4220b images nas4220b - Update preinit MAC detection script to handle also DNS-313 - Add board.d/03_hdparm to set the disk to spin down after 1 minute by default, if we have the hdparm tool installed ChangeLog v1->v2: - Processed config through kernel_oldconfig - Processed patches through make target/linux/{clean,refresh} V=99 Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Roman Yeryomin <roman@advem.lv>
113 lines
3.1 KiB
Diff
113 lines
3.1 KiB
Diff
From 09240ae27ffca65518f7b9d2360c020c1b1ddabe Mon Sep 17 00:00:00 2001
|
|
From: Linus Walleij <linus.walleij@linaro.org>
|
|
Date: Sat, 28 Oct 2017 15:37:18 +0200
|
|
Subject: [PATCH 05/31] pinctrl: gemini: Use generic DT parser
|
|
|
|
We can just use the generic Device Tree parser code
|
|
in this driver and save some code.
|
|
|
|
Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
|
|
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
|
---
|
|
drivers/pinctrl/Kconfig | 1 +
|
|
drivers/pinctrl/pinctrl-gemini.c | 66 +++-------------------------------------
|
|
2 files changed, 5 insertions(+), 62 deletions(-)
|
|
|
|
--- a/drivers/pinctrl/Kconfig
|
|
+++ b/drivers/pinctrl/Kconfig
|
|
@@ -153,6 +153,7 @@ config PINCTRL_GEMINI
|
|
depends on ARCH_GEMINI
|
|
default ARCH_GEMINI
|
|
select PINMUX
|
|
+ select GENERIC_PINCONF
|
|
select MFD_SYSCON
|
|
|
|
config PINCTRL_MCP23S08
|
|
--- a/drivers/pinctrl/pinctrl-gemini.c
|
|
+++ b/drivers/pinctrl/pinctrl-gemini.c
|
|
@@ -13,6 +13,8 @@
|
|
#include <linux/pinctrl/machine.h>
|
|
#include <linux/pinctrl/pinctrl.h>
|
|
#include <linux/pinctrl/pinmux.h>
|
|
+#include <linux/pinctrl/pinconf.h>
|
|
+#include <linux/pinctrl/pinconf-generic.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/regmap.h>
|
|
@@ -1918,73 +1920,13 @@ static void gemini_pin_dbg_show(struct p
|
|
seq_printf(s, " " DRIVER_NAME);
|
|
}
|
|
|
|
-static int gemini_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
|
|
- struct device_node *np,
|
|
- struct pinctrl_map **map,
|
|
- unsigned int *reserved_maps,
|
|
- unsigned int *num_maps)
|
|
-{
|
|
- int ret;
|
|
- const char *function = NULL;
|
|
- const char *group;
|
|
- struct property *prop;
|
|
-
|
|
- ret = of_property_read_string(np, "function", &function);
|
|
- if (ret < 0)
|
|
- return ret;
|
|
-
|
|
- ret = of_property_count_strings(np, "groups");
|
|
- if (ret < 0)
|
|
- return ret;
|
|
-
|
|
- ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps,
|
|
- num_maps, ret);
|
|
- if (ret < 0)
|
|
- return ret;
|
|
-
|
|
- of_property_for_each_string(np, "groups", prop, group) {
|
|
- ret = pinctrl_utils_add_map_mux(pctldev, map, reserved_maps,
|
|
- num_maps, group, function);
|
|
- if (ret < 0)
|
|
- return ret;
|
|
- pr_debug("ADDED FUNCTION %s <-> GROUP %s\n",
|
|
- function, group);
|
|
- }
|
|
-
|
|
- return 0;
|
|
-}
|
|
-
|
|
-static int gemini_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|
- struct device_node *np_config,
|
|
- struct pinctrl_map **map,
|
|
- unsigned int *num_maps)
|
|
-{
|
|
- unsigned int reserved_maps = 0;
|
|
- struct device_node *np;
|
|
- int ret;
|
|
-
|
|
- *map = NULL;
|
|
- *num_maps = 0;
|
|
-
|
|
- for_each_child_of_node(np_config, np) {
|
|
- ret = gemini_pinctrl_dt_subnode_to_map(pctldev, np, map,
|
|
- &reserved_maps, num_maps);
|
|
- if (ret < 0) {
|
|
- pinctrl_utils_free_map(pctldev, *map, *num_maps);
|
|
- return ret;
|
|
- }
|
|
- }
|
|
-
|
|
- return 0;
|
|
-};
|
|
-
|
|
static const struct pinctrl_ops gemini_pctrl_ops = {
|
|
.get_groups_count = gemini_get_groups_count,
|
|
.get_group_name = gemini_get_group_name,
|
|
.get_group_pins = gemini_get_group_pins,
|
|
.pin_dbg_show = gemini_pin_dbg_show,
|
|
- .dt_node_to_map = gemini_pinctrl_dt_node_to_map,
|
|
- .dt_free_map = pinctrl_utils_free_map,
|
|
+ .dt_node_to_map = pinconf_generic_dt_node_to_map_group,
|
|
+ .dt_free_map = pinconf_generic_dt_free_map,
|
|
};
|
|
|
|
/**
|