Commit 49ab7c822227f28912a6c6743e027c1c4dd0d739

Authored by LCPD Auto Merger

Merge branch 'ti-linux-4.1.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-lsk-linux-4.1.y

TI-Feature: ti_linux_base_lsk
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.1.y

* 'ti-linux-4.1.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ARM: dts: k2g-evm: update dts to enable mdio bindings
  ARM: dts: k2g: add netcp bindings to support nss lite
  ti_config_fragments/connectivity.cfg: enable Micrel phy
  Revert "net: netcp: remove dead code from the driver"
  net: netcp: support probe deferral
  soc: ti: provide APIs to support driver probe deferral

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>

Showing 9 changed files Side-by-side Diff

arch/arm/boot/dts/k2g-evm.dts
... ... @@ -283,4 +283,16 @@
283 283 dr_mode = "host";
284 284 status = "okay";
285 285 };
  286 +
  287 +&mdio {
  288 + status = "okay";
  289 + ethphy0: ethernet-phy@0 {
  290 + reg = <0>;
  291 + phy-mode = "rgmii-id";
  292 + };
  293 +};
  294 +
  295 +&gbe0 {
  296 + phy-handle = <&ethphy0>;
  297 +};
arch/arm/boot/dts/k2g-netcp.dtsi
  1 +/*
  2 + * Device Tree Source for Keystone 2 Galileo Netcp driver
  3 + *
  4 + * Copyright 2015 Texas Instruments, Inc.
  5 + *
  6 + * This program is free software; you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License version 2 as
  8 + * published by the Free Software Foundation.
  9 + */
  10 +
  11 +qmss: qmss@4020000 {
  12 + compatible = "ti,keystone-navigator-qmss-l";
  13 + dma-coherent;
  14 + #address-cells = <1>;
  15 + #size-cells = <1>;
  16 + power-domains = <&k2g_pds K2G_DEV_NSS0>;
  17 + clocks = <&k2g_clks K2G_DEV_NSS0 K2G_DEV_NSS_VCLK>;
  18 + clock-names = "nss_vclk";
  19 + ranges;
  20 + queue-range = <0 0x80>;
  21 + linkram0 = <0x4020000 0x7ff>;
  22 +
  23 + qmgrs {
  24 + #address-cells = <1>;
  25 + #size-cells = <1>;
  26 + ranges;
  27 + qmgr0 {
  28 + managed-queues = <0 0x80>;
  29 + reg = <0x4100000 0x800>,
  30 + <0x4040000 0x100>,
  31 + <0x4080000 0x800>,
  32 + <0x40c0000 0x800>;
  33 + reg-names = "peek", "config",
  34 + "region", "push";
  35 + };
  36 +
  37 + };
  38 + queue-pools {
  39 + qpend {
  40 + qpend-0 {
  41 + qrange = <77 8>;
  42 + interrupts =<0 308 0xf04 0 309 0xf04 0 310 0xf04
  43 + 0 311 0xf04 0 312 0xf04 0 313 0xf04
  44 + 0 314 0xf04 0 315 0xf04>;
  45 + qalloc-by-id;
  46 + };
  47 + };
  48 + general-purpose {
  49 + gp-0 {
  50 + qrange = <112 8>;
  51 + };
  52 + netcp-tx {
  53 + qrange = <5 8>;
  54 + qalloc-by-id;
  55 + };
  56 + };
  57 + };
  58 +
  59 + descriptor-regions {
  60 + #address-cells = <1>;
  61 + #size-cells = <1>;
  62 + ranges;
  63 + region-12 {
  64 + id = <12>;
  65 + region-spec = <1023 128>; /* num_desc desc_size */
  66 + link-index = <0x400>;
  67 + };
  68 + };
  69 +}; /* qmss */
  70 +
  71 +knav_dmas: knav_dmas@0 {
  72 + compatible = "ti,keystone-navigator-dma";
  73 + #address-cells = <1>;
  74 + #size-cells = <1>;
  75 + power-domains = <&k2g_pds K2G_DEV_NSS0>;
  76 + clocks = <&k2g_clks K2G_DEV_NSS0 K2G_DEV_NSS_VCLK>;
  77 + clock-names = "nss_vclk";
  78 + ranges;
  79 + ti,navigator-cloud-address = <0x40c0000 0x40c0000 0x40c0000 0x40c0000>;
  80 +
  81 + dma_gbe: dma_gbe@0 {
  82 + reg = <0x4010000 0x100>,
  83 + <0x4011000 0x2a0>, /* 21 Tx channels */
  84 + <0x4012000 0x400>, /* 32 Rx channels */
  85 + <0x4010100 0x80>,
  86 + <0x4013000 0x400>; /* 32 Rx flows */
  87 + reg-names = "global", "txchan", "rxchan",
  88 + "txsched", "rxflow";
  89 + };
  90 +
  91 +};
  92 +
  93 +gbe_subsys: subsys@4200000 {
  94 + compatible = "syscon";
  95 + reg = <0x4200000 0x100>;
  96 +};
  97 +
  98 +netcp: netcp@4000000 {
  99 + reg = <0x2620110 0x8>;
  100 + reg-names = "efuse";
  101 + compatible = "ti,netcp-1.0";
  102 + #address-cells = <1>;
  103 + #size-cells = <1>;
  104 + power-domains = <&k2g_pds K2G_DEV_NSS0>;
  105 + clocks = <&k2g_clks K2G_DEV_NSS0 K2G_DEV_NSS_ESW_CLK>;
  106 + clock-names = "ethss_clk";
  107 +
  108 + /* NetCP address range */
  109 + ranges = <0 0x4000000 0x1000000>;
  110 +
  111 + dma-coherent;
  112 +
  113 + ti,navigator-dmas = <&dma_gbe 0>, <&dma_gbe 5>;
  114 + ti,navigator-dma-names = "netrx0", "nettx";
  115 +
  116 + netcp-devices {
  117 + #address-cells = <1>;
  118 + #size-cells = <1>;
  119 + ranges;
  120 + gbe@200000 {
  121 + label = "netcp-gbe";
  122 + compatible = "ti,netcp-gbe-2";
  123 + syscon-subsys = <&gbe_subsys>;
  124 + reg = <0x200100 0xe00>, <0x220000 0x20000>;
  125 + /* enable-ale; */
  126 + tx-queue = <5>;
  127 + tx-channel = "nettx";
  128 +
  129 + interfaces {
  130 + gbe0: interface-0 {
  131 + slave-port = <0>;
  132 + link-interface = <5>;
  133 + };
  134 + };
  135 + };
  136 + };
  137 +
  138 + netcp-interfaces {
  139 + interface-0 {
  140 + rx-channel = "netrx0";
  141 + rx-pool = <512 12>;
  142 + tx-pool = <511 12>;
  143 + rx-queue-depth = <128 128 0 0>;
  144 + rx-buffer-size = <1518 4096 0 0>;
  145 + rx-queue = <77>;
  146 + tx-completion-queue = <78>;
  147 + efuse-mac = <1>;
  148 + netcp-gbe = <&gbe0>;
  149 + };
  150 + };
  151 +};
arch/arm/boot/dts/k2g.dtsi
... ... @@ -474,6 +474,20 @@
474 474 #power-domain-cells = <1>;
475 475 ti,sci = <&pmmc>;
476 476 };
  477 +
  478 + mdio: mdio@4200f00 {
  479 + compatible = "ti,keystone_mdio", "ti,davinci_mdio";
  480 + #address-cells = <1>;
  481 + #size-cells = <0>;
  482 + power-domains = <&k2g_pds K2G_DEV_NSS0>;
  483 + clocks = <&k2g_clks K2G_DEV_NSS0 K2G_DEV_NSS_ESW_CLK>;
  484 + clock-names = "fck";
  485 + reg = <0x04200f00 0x100>;
  486 + status = "disabled";
  487 + bus_freq = <2500000>;
  488 + };
  489 +
  490 + #include "k2g-netcp.dtsi"
477 491 };
478 492 };
drivers/net/ethernet/ti/netcp_core.c
... ... @@ -2055,8 +2055,13 @@
2055 2055 struct device_node *child, *interfaces;
2056 2056 struct netcp_device *netcp_device;
2057 2057 struct device *dev = &pdev->dev;
  2058 + struct netcp_module *module;
2058 2059 int ret;
2059 2060  
  2061 + if (!knav_dma_device_ready() ||
  2062 + !knav_qmss_device_ready())
  2063 + return -EPROBE_DEFER;
  2064 +
2060 2065 if (!node) {
2061 2066 dev_err(dev, "could not find device info\n");
2062 2067 return -ENODEV;
... ... @@ -2101,6 +2106,14 @@
2101 2106 /* Add the device instance to the list */
2102 2107 list_add_tail(&netcp_device->device_list, &netcp_devices);
2103 2108  
  2109 + /* Probe & attach any modules already registered */
  2110 + mutex_lock(&netcp_modules_lock);
  2111 + for_each_netcp_module(module) {
  2112 + ret = netcp_module_probe(netcp_device, module);
  2113 + if (ret < 0)
  2114 + dev_err(dev, "module(%s) probe failed\n", module->name);
  2115 + }
  2116 + mutex_unlock(&netcp_modules_lock);
2104 2117 return 0;
2105 2118  
2106 2119 probe_quit_interface:
drivers/soc/ti/knav_dma.c
... ... @@ -133,7 +133,13 @@
133 133 ch->channel : ch->flow)
134 134  
135 135 static struct knav_dma_pool_device *kdev;
  136 +static bool device_ready;
136 137  
  138 +bool knav_dma_device_ready(void)
  139 +{
  140 + return device_ready;
  141 +}
  142 +
137 143 static bool check_config(struct knav_dma_chan *chan, struct knav_dma_cfg *cfg)
138 144 {
139 145 if (!memcmp(&chan->cfg, cfg, sizeof(*cfg)))
... ... @@ -773,6 +779,7 @@
773 779 debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL,
774 780 &knav_dma_debug_ops);
775 781  
  782 + device_ready = true;
776 783 return ret;
777 784 }
778 785  
drivers/soc/ti/knav_qmss_queue.c
... ... @@ -83,6 +83,13 @@
83 83 */
84 84 const char *knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin"};
85 85  
  86 +static bool device_ready;
  87 +
  88 +bool knav_qmss_device_ready(void)
  89 +{
  90 + return device_ready;
  91 +}
  92 +
86 93 /**
87 94 * knav_queue_notify: qmss queue notfier call
88 95 *
... ... @@ -1852,6 +1859,7 @@
1852 1859  
1853 1860 debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
1854 1861 &knav_queue_debug_ops);
  1862 + device_ready = true;
1855 1863 return 0;
1856 1864  
1857 1865 err:
include/linux/soc/ti/knav_dma.h
... ... @@ -161,6 +161,7 @@
161 161 void *knav_dma_open_channel(struct device *dev, const char *name,
162 162 struct knav_dma_cfg *config);
163 163 void knav_dma_close_channel(void *channel);
  164 +bool knav_dma_device_ready(void);
164 165 #else
165 166 static inline void *knav_dma_open_channel(struct device *dev, const char *name,
166 167 struct knav_dma_cfg *config)
... ... @@ -169,6 +170,10 @@
169 170 }
170 171 static inline void knav_dma_close_channel(void *channel)
171 172 {}
  173 +bool knav_dma_device_ready(void)
  174 +{
  175 + return false;
  176 +}
172 177  
173 178 #endif
174 179  
include/linux/soc/ti/knav_qmss.h
... ... @@ -86,6 +86,7 @@
86 86 void *knav_pool_desc_unmap(void *ph, dma_addr_t dma, unsigned dma_sz);
87 87 dma_addr_t knav_pool_desc_virt_to_dma(void *ph, void *virt);
88 88 void *knav_pool_desc_dma_to_virt(void *ph, dma_addr_t dma);
  89 +bool knav_qmss_device_ready(void);
89 90  
90 91 #endif /* __SOC_TI_KNAV_QMSS_H__ */
ti_config_fragments/connectivity.cfg
... ... @@ -139,6 +139,9 @@
139 139 CONFIG_IP_SCTP=m
140 140 CONFIG_VLAN_8021Q=m
141 141  
  142 +#MDIO phys
  143 +CONFIG_MICREL_PHY=y
  144 +
142 145 #MMC
143 146 CONFIG_MMC=y
144 147 CONFIG_MMC_OMAP_HS=y