summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/mach-imx6q.c
diff options
context:
space:
mode:
authorBai Ping <b51503@freescale.com>2015-09-25 00:49:13 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:20:42 +0300
commit0b8a6971ced6489ebda85c3b82c621a7c3900cec (patch)
tree18430e2d86943bfa623de7beab226cce9e19571d /arch/arm/mach-imx/mach-imx6q.c
parent3fc1b71afd1b9c09f20d2858f7c80e1679544e82 (diff)
MLK-11620 ARM: imx: single SOC config/compile support
Currently, all i.MX6 config (CONFIG_SOC_IMX6XXX) are enabled, so build and function are OK for every i.MX6 SOC, however, when only one SOC config is selected in menu config, for example, users only needs i.MX6SL, they might deselect all reset SOC configs, then the build will fail, this is unacceptable. Signed-off-by: Anson Huang <b20788@freescale.com> Signed-off-by: Bai Ping <b51503@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 13e8e286134a..b9bd608c6a59 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -303,84 +303,6 @@ static void __init imx6q_enet_clk_sel(void)
pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
}
-#define OCOTP_MACn(n) (0x00000620 + (n) * 0x10)
-void __init imx6_enet_mac_init(const char *enet_compat, const char *ocotp_compat)
-{
- struct device_node *ocotp_np, *enet_np, *from = NULL;
- void __iomem *base;
- struct property *newmac;
- u32 macaddr_low;
- u32 macaddr_high = 0;
- u32 macaddr1_high = 0;
- u8 *macaddr;
- int i;
-
- for (i = 0; i < 2; i++) {
- enet_np = of_find_compatible_node(from, NULL, enet_compat);
- if (!enet_np)
- return;
-
- from = enet_np;
-
- if (of_get_mac_address(enet_np))
- goto put_enet_node;
-
- ocotp_np = of_find_compatible_node(NULL, NULL, ocotp_compat);
- if (!ocotp_np) {
- pr_warn("failed to find ocotp node\n");
- goto put_enet_node;
- }
-
- base = of_iomap(ocotp_np, 0);
- if (!base) {
- pr_warn("failed to map ocotp\n");
- goto put_ocotp_node;
- }
-
- macaddr_low = readl_relaxed(base + OCOTP_MACn(1));
- if (i)
- macaddr1_high = readl_relaxed(base + OCOTP_MACn(2));
- else
- macaddr_high = readl_relaxed(base + OCOTP_MACn(0));
-
- newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);
- if (!newmac)
- goto put_ocotp_node;
-
- newmac->value = newmac + 1;
- newmac->length = 6;
- newmac->name = kstrdup("local-mac-address", GFP_KERNEL);
- if (!newmac->name) {
- kfree(newmac);
- goto put_ocotp_node;
- }
-
- macaddr = newmac->value;
- if (i) {
- macaddr[5] = (macaddr_low >> 16) & 0xff;
- macaddr[4] = (macaddr_low >> 24) & 0xff;
- macaddr[3] = macaddr1_high & 0xff;
- macaddr[2] = (macaddr1_high >> 8) & 0xff;
- macaddr[1] = (macaddr1_high >> 16) & 0xff;
- macaddr[0] = (macaddr1_high >> 24) & 0xff;
- } else {
- macaddr[5] = macaddr_high & 0xff;
- macaddr[4] = (macaddr_high >> 8) & 0xff;
- macaddr[3] = (macaddr_high >> 16) & 0xff;
- macaddr[2] = (macaddr_high >> 24) & 0xff;
- macaddr[1] = macaddr_low & 0xff;
- macaddr[0] = (macaddr_low >> 8) & 0xff;
- }
-
- of_update_property(enet_np, newmac);
-
-put_ocotp_node:
- of_node_put(ocotp_np);
-put_enet_node:
- of_node_put(enet_np);
- }
-}
-
static inline void imx6q_enet_init(void)
{
imx6_enet_mac_init("fsl,imx6q-fec", "fsl,imx6q-ocotp");