Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2016 11:33:01 -0800
From:      Thomas Skibo <thomasskibo@yahoo.com>
To:        freebsd-arm@freebsd.org, =?utf-8?Q?Daniel_H=C3=BCbleitner?= <daniel.huebleitner@student.tuwien.ac.at>
Subject:   Re: Finally bringing FreeBSD to Parallella
Message-ID:  <2CAC521E-AB65-453F-B1CC-DE025DA43596@yahoo.com>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_AA84A1E2-5020-413E-8832-953C02FE2E4D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hello.

Using the GNU dts files for Zynq boards is not as easy as just adding =
the proper compat strings.  Off the top of my head:

- A range of physical memory must be reserved because it is not =
accessible by all AXI masters.  This is done in zynq-7000.dtsi right now =
but maybe it can be done in zy7_machdep.c (?))
- Several peripherals (including mpcore-timers) must derive their =
reference clock speed automagically from the PS clock speed instead of =
being specified in each peripheral's device tree entry.
- The ethernet driver needs to be able to change its reference clock in =
response to media speed changes.  The hack I use for this requires the =
ethernet=E2=80=99s device tree entry to specify the =E2=80=9Cunit =
number" of its reference clock so it can request speed changes from the =
SLCR block.

It=E2=80=99s kind of on my to-do list to have GNU DTS files working for =
12.0 but I haven=E2=80=99t been working on it lately.

Regarding Parallella:

I had FreeBSD booting on Parallella several years ago but I bricked my =
board and so I stopped updating it.  The Parallella has u-boot in a =
flash memory but without the API option. Rather than trying to re-flash =
the u-boot and risk bricking the Parallella (which I eventually did =
anyway), I packaged a u-boot binary with the proper options in a uImage =
file so the boot process was FSBL =E2=80=94> U-boot =E2=80=94> U-boot =
=E2=80=94> ubldr =E2=80=94> FreeBSD.  The uImage file I used is in a =
tarball at http://www.skibo.net/zedbsd/parallella_freebsd.tgz .

I think it would be better, for now, to use RELEASE-11.0 which has good =
Zynq support and just come up with a BSD style DTS file for Parallella.  =
I think the only difference between Parallella and Zedboard is that the =
SD card is attached to SDHCI1 instead of SDHCI0 and the memory size is =
larger.  My best guess for a DTS file is attached.

Happy New Year.

=E2=80=94
Thomas Skibo
thomasskibo@yahoo.com



--Apple-Mail=_AA84A1E2-5020-413E-8832-953C02FE2E4D
Content-Disposition: attachment;
	filename=parallella.dts
Content-Type: application/octet-stream;
	name="parallella.dts"
Content-Transfer-Encoding: 7bit

/*-
 * Copyright (c) 2016 The FreeBSD Foundation
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 * $FreeBSD$
 */
/dts-v1/;
/include/ "zynq-7000.dtsi"

/ {
	model = "parallella";
	compatible = "adapteva,parallella";

	memory {
		// First megabyte isn't accessible by all interconnect masters.
		device_type = "memory";
		reg = <0x100000 0x3ff00000>;	/* 1GB RAM at 0x100000 */
	};

	fb0: fb@43000000 {
	          compatible = "xlnx,xlnx-fb";
	     	  reg = <0x43000000 0x10000>,
	     	        <0x43c00000 0x10000>;
	};

	chosen {
		stdin = &uart1;
		stdout = &uart1;
	};
};

&slcr {
	clock-frequency = <33333333>; // 33Mhz PS_CLK
};

&global_timer {
	clock-frequency = <333333333>; // 333Mhz
};

&uart1 {
	status = "okay";
};

&eth0 {
	status = "okay";
};

&sdhci1 {
	status = "okay";
};

&ehci0 {
	status = "okay";
};


--Apple-Mail=_AA84A1E2-5020-413E-8832-953C02FE2E4D--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2CAC521E-AB65-453F-B1CC-DE025DA43596>