Problem with L4Linux accessing ethernet clocks

Manolis Ragkousis manolis837 at gmail.com
Fri Sep 22 16:05:58 CEST 2017


Hello everyone,

I am having trouble getting the network to work on L4Linux running on
the zedboard. I have enabled the macb driver which my net card needs, I
have created a device tree telling l4linux where to find the device and
I have written the io configuration.

The problem is that L4linux doesn't have access to the 3 clocks it needs
for the network device to work. Those are "pclk", "hclk", "tx_clk". I
understand that I have to assign those clocks to l4linux. But how can I
do that? I cannot find any examples of assigning clocks. Won't this
create an issue to the Fiasco kernel? Should the driver use "l4kipclk"
instead of "pclk"?

Below you will find the dmesg output, my io files, my cfg file and the
device tree.

Thank you for your time and help!
Manolis

----dmesg output part begin----
__l4x_ioremap: Mapping physaddr e000b000 [0x1000 Bytes, e000b000+001000]
to 00002000+000000
/amba/ethernet at e000b000: could not find phandle
ERROR: could not get clock /amba/ethernet at e000b000:pclk(0)
macb e000b000.ethernet: failed to get macb_clk (4294967294)
macb: probe of e000b000.ethernet failed with error -2
----dmesg output part end----

---- zynq.dts begin ----
 {
	model = "L4Linux (DT)";
	compatible = "L4Linux";

	#address-cells = <1>;
	#size-cells = <1>;
	chosen { };
	aliases { };

	amba {
		compatible = "simple-bus";
		#address-cells = <0x1>;
		#size-cells = <0x1>;
		interrupt-parent = <0x3>;
		ranges;

        ethernet at e000b000 {
            compatible = "cdns,zynq-gem", "cdns,gem", "cdns,macb";
			reg = <0xe000b000 0x1000>;
			status = "okay";
			interrupts = <0x0 0x16 0x4>;
			clocks = <0x1 0x1e 0x1 0x1e 0x1 0xd>;
			clock-names = "pclk", "hclk", "tx_clk";
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			phy-mode = "rgmii-id";
			phy-handle = <0x4>;

			ethernet-phy at 0 {
				reg = <0x0>;
				linux,phandle = <0x4>;
				phandle = <0x4>;
			};
		};
	};		
};
---- zynq.dts end ----

---- zedboard.devs begin ----
local Res = Io.Res
local Hw = Io.Hw

Io.hw_add_devices(function()
      NIC = Hw.Device(function()
            compatible = {"cdns,zynq-gem", "cdns,gem", "cdns,macb"};
            Property.hid  = "cdns,zynq-gem";
            Property.flags = Io.Hw_device_DF_dma_supported;
            Resource.irq  = Io.Res.irq(54);
            Resource.mem = Res.mmio(0xe000b000, 0xe000bfff);
      end);
end);
---- zedboard.devs end ----

---- hw_devices.io begin ----

local Hw = Io.system_bus()

Io.add_vbus("l4linux", Io.Vi.System_bus
{
   ethernet = wrap(Hw.NIC);
})

---- hw_devices.io end ----

---- l4lx.cfg begin ----
local L4 = require("L4");

local loader = L4.default_loader;

local lxname = "vmlinuz";

-- Start io

vbus_l4linux = loader:new_channel();
local vbus_input = loader:new_channel();

loader:start(
  {
    caps = {
      sigma0  = L4.cast(L4.Proto.Factory,
L4.Env.sigma0):create(L4.Proto.Sigma0);
      icu     = L4.Env.icu;
      input = vbus_input:svr();
      l4linux = vbus_l4linux:svr();
    },
    log = { "IO", "y" },
    l4re_dbg = L4.Dbg.Warn,
  }, "rom/io rom/zedboard.devs rom/hw_devices.io");




L4.default_loader:start(
    { caps = {
           vbus = vbus_l4linux;
           },
           l4re_dbg = L4.Dbg.Warn,
           log = L4.Env.log:m("rws"),
},


    "rom/vmlinuz mem=312M console=ttyLv0 " ..
    "l4x_dtb=rom/zynq-zed.dtb " ..
    "l4x_rd=rom/ramdisk-" ..  L4.Info.arch() .. ".rd "
    .. "root=1:0 ramdisk_size=5000");

---- l4lx.cfg end ----





More information about the l4-hackers mailing list