Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2015 14:41:06 +0300
From:      Mihai Carabas <mihai.carabas@gmail.com>
To:        freebsd-arm@freebsd.org
Subject:   Re: porting freebsd-arm on FastModels - CortexA15
Message-ID:  <CANg1yUu599oKs0GiCm6pVZ62ecJcdfT-mqCz=So2%2BESctJsQYQ@mail.gmail.com>
In-Reply-To: <CANg1yUt%2BfaNUyJre66Q4DESPVTemviEPAG8eFCExw=avfdq-TQ@mail.gmail.com>
References:  <CANg1yUt%2BfaNUyJre66Q4DESPVTemviEPAG8eFCExw=avfdq-TQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 13, 2015 at 4:59 PM, Mihai Carabas <mihai.carabas@gmail.com>
wrote:

> Hello,
>
> My name is Mihai Carabas and I am a GSoC student this year on porting
> bhyve over ARM. Right now I'm working on booting FreeBSD ARM on an
> CortexA15 emulated platform running with FastModels.
>
> I have two problems until now:
>
> a) I used the DTS from sys/gnu/dts/arm/vexpress-v2p-ca15-tc1.dts and I
> build the FDT directly in the kernel. I have a problem with the address
> calculated for the serial0 console.
>
> The DTB parser selects the first range from the bus:
> 228 >------->-------ranges = <0 0 0 0x08000000 0x04000000>,
> 229 >------->------->------- <1 0 0 0x14000000 0x04000000>,
> 230 >------->------->------- <2 0 0 0x18000000 0x04000000>,
> 231 >------->------->------- <3 0 0 0x1c000000 0x04000000>,
> 232 >------->------->------- <4 0 0 0x0c000000 0x04000000>,
> 233 >------->------->------- <5 0 0 0x10000000 0x04000000>;
>
> The valid range for this platform is the entry starting with 3 (the
> console is mapped at address 0x1c090000). But the parser ellects the first
> range.
>
> The console is declared like this (as a child to iofpga root node):
>  68 >------->-------iofpga@3,00000000 {
>  69 >------->------->-------compatible = "arm,amba-bus", "simple-bus";
>  70 >------->------->-------#address-cells = <1>;
>  71 >------->------->-------#size-cells = <1>;
>  72 >------->------->-------ranges = <0 3 0 0x200000>;
> ........
> 156 >------->------->-------v2m_serial0: uart@090000 {
> 157 >------->------->------->-------compatible = "arm,pl011",
> "arm,primecell";
> 158 >------->------->------->-------reg = <0x090000 0x1000>;
> 159 >------->------->------->-------interrupts = <5>;
> 160 >------->------->------->-------clocks = <&v2m_oscclk2>, <&smbclk>;
> 161 >------->------->------->-------clock-names = "uartclk", "apb_pclk";
> 162 >------->------->-------};
>
> As you can see the iofgpa selects the chip number 3, which is ok, but the
> final address computed by the FreeBSD parser isn't. Any thoughts on this?
>
> b) To force the things, I've delete the other ranges, and just let the
> 0x1c000000. Until now I've managed to get to message buffer
> initialization in initarm. If I initialize the message buffers (in
> particular set msgbufmapped = 1;), the next printf is being trashed: it
> prints only the first letter and than the 's' char for a couple of times
> and than it gets into a data abort exception. It seems that the message
> buffer gets corrupted. I've checked the memory allocated and mapped for the
> message buffer (msgbufp in initarm [pmap_new]) and is ok. Are there other
> parts of the machine dependent code that could affect the message buffer?
>
> If I don't initialize the message buffer it goes further without any
> problems, ending up in the mi_startup and about the end.
>

I managed to pass through all these problems by fixing the DTS bugs (with
some workarounds) that appeared and enabling some register access from
secure-world in the boot-wrapper (the machine starts in SecureWorld and
must give access to all coprocessors for NormalWorld).

I've managed to get to interrupt controller and timer initialization, and
it breaks at uart_ungrab [1]. Before this are some strange erros regarding
the interrupts-cells. I don't understand why it complains with that 3 value
(indeed the parent has size 3 for interrupts-cells, but the child node has
it's value at 1). Anyone has any idea why this is happening?

Thank you,
Mihai

[1] https://wiki.freebsd.org/MihaiCarabas/bootup.log



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANg1yUu599oKs0GiCm6pVZ62ecJcdfT-mqCz=So2%2BESctJsQYQ>