Date: Sun, 25 Dec 2016 18:30:45 -0800 From: Oleksandr Tymoshenko <gonzo@bluezbox.com> To: =?utf-8?Q?Daniel_H=C3=BCbleitner?= <daniel.huebleitner@student.tuwien.ac.at> Cc: freebsd-arm@freebsd.org Subject: Re: Finally bringing FreeBSD to Parallella Message-ID: <C6333101-D91F-48D3-9C8F-F19D3C4E0169@bluezbox.com> In-Reply-To: <7E7AC5B2-02A5-462B-B111-F0C7DCF59DF4@student.tuwien.ac.at> References: <7E7AC5B2-02A5-462B-B111-F0C7DCF59DF4@student.tuwien.ac.at>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Dec 25, 2016, at 5:05 PM, Daniel H=C3=BCbleitner = <daniel.huebleitner@student.tuwien.ac.at> wrote: >=20 > Merry Christmas everyone, >=20 > I am trying to port FreeBSD on the parallella board. So far I just = wrote a kernel config where I included the zedboard config. I can build = the world no problem. Where I ran into trouble is trying to statically = compile the DTB. I have to say I dont really understand how the OS knows = the driver it should use from the DTS. Furthermore there is a DTS under = GPL from Xilinx itself in ../../../gnu/dts/arm/zynq-parallella.dts. How = can it be that the Vendor DTS is so much different from the BSD DTS in = sys/boot/fdt/dts. Shouldnt be there just one correct DTS for each board? = And could it work if I just use the Vendor DTS? It looks to me that = everybody just writes the DTS the way they want and due to a miracle it = somehow works. >=20 > So what I=C2=B4m trying to say is, would someone be interested in = helping me bringing FreeBSD to the parallella micro-server. Its the = first time I try to port BSD and I am doing it as part of a university = project where I want to benchmark FreeBSD against Linux.=20 >=20 > I attached the kernel config I have so far. There are some links to = the hardware in the config header. Hi Daniel Some boards have FreeBSD-specific DTS for historical reasons (one of them - people were not sure that using GNU dts was OK). So most of the platforms with early FDT support ended up with non-standard DTS files. Since then some of them were converted to using upstream dtbs: TI platforms and Raspberry Pi's for one. Zynq is probably the last one that hasn=E2=80=99t been converted yet. I went through zynq-7000.dtsi and it seems that the conversion should be fairly simple: most of the nodes require only new "compatible" strings in the existing drivers. Something like patch below. We can not replace the strings, we have to maintain backward compatibility.=20 There might be more work though. Base addresses for register may be different, some other properties' names might mismatch. But it should be fairly easy to do. Let me know if you're going to work on this conversion. Otherwise I'll try to do it myself some time next week.=20 % svn diff arm/xilinx/zy7_gpio.c Index: arm/xilinx/zy7_gpio.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- arm/xilinx/zy7_gpio.c (revision 310551) +++ arm/xilinx/zy7_gpio.c (working copy) @@ -114,6 +114,12 @@ #define ZY7_GPIO_INT_POLARITY(b) (0x0220+0x40*(b)) /* int = polarity */ #define ZY7_GPIO_INT_ANY(b) (0x0224+0x40*(b)) /* any edge */ +static struct ofw_compat_data compat_data[] =3D { + {"xlnx,zy7_gpio", 1}, + {"xlnx,zynq-gpio-1.0", 1}, + {NULL, 0} +}; + static device_t zy7_gpio_get_bus(device_t dev) { @@ -289,7 +295,7 @@ if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "xlnx,zy7_gpio")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data =3D=3D = 0) return (ENXIO); device_set_desc(dev, "Zynq-7000 GPIO driver");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C6333101-D91F-48D3-9C8F-F19D3C4E0169>