Cubieboard2 with custom bootloader

Mihai Carabas mihai.carabas at gmail.com
Wed Jan 25 14:53:39 UTC 2017


Hello again,

We have some trouble with writing in memory in locore-v6.S. We added the
following sequence:
       mov     r0, 1
    ldr     r1, =hypmode_enabled
    str     r0, [r1]
    mov     r0, 123
    ldr     r0, [r1]
    cmp     r0, #123
    beq     _C_LABEL(panic)

............

_C_LABEL(hypmode_enabled):
	.word 0



The problem is that the flow doesn't enter on the last beq. Full code is in
https://svn.grid.pub.ro/svn/bhyve-ARM/src/sys/arm/arm/locore-v6.S

Does anyone have any insight about this problem? Caches could be a problem?

Thank you,
Mihai

On Mon, Jan 9, 2017 at 4:07 PM, Mihai Carabas <mihai.carabas at gmail.com>
wrote:

> Hello everyone,
>
> We managed to boot the Cubie2 with a custom bootloader, but we are still
> having trouble in executing "hvc" instruction (it ends up with undefined
> instruction in kernel). At this point I think is an SMP related issue. The
> bhyvearm code was only tested on an emulated platform with one core. For
> SMP there is still work that need to be done. We tried to disable the SMP
> for Cubie2 but without luck.
> We disabled the following options
> options SMP
> options PLATFORM_SMP
>
> But is still compiling with SMP. Do you have any insights for this?
>
> Thank  you,
> Mihai
>
> On Thu, Dec 15, 2016 at 6:03 PM, Ian Lepore <ian at freebsd.org> wrote:
>
>> On Thu, 2016-12-15 at 13:35 +0100, Emmanuel Vadot wrote:
>> > On Thu, 15 Dec 2016 14:26:48 +0200
>> > Nicolae-Alexandru Ivan <alexnivan at gmail.com> wrote:
>> >
>> > >
>> > > >
>> > > >  For 1 and 2, as Ganbold said ubldr is broken since clang 3.9
>> > > > import
>> > > > (well only ubldr.bin for me ...)
>> > > >  For 3 and 4 I've never tested booting kernel directly, I'll try
>> > > > that.
>> > > >  Does your kernel have a static dtb compiled in ?
>> > > Yes, we included the device tree in the kernel binary.
>> > > The options below are included in our conf.
>> > >
>> > > #FDT
>> > > options FDT
>> > > options FDT_DTB_STATIC
>> > > makeoptions FDT_DTS_FILE=cubieboard2.dts
>> >  Oh I might now, my patches introduce a FreeBSD option for uboot that
>> > disable the dcache while it's strictly disable in the ports.
>> >  Do a gmake menuconfig in uboot before compiling but after gmake
>> > cubieboard2_defconfig to enable this.
>> >
>>
>> It shouldn't be necessary to disable dcache, but it does need to be
>> flushed before launching ubldr or the kernel; especially, it needs the
>> icache sync'd.  The stock uboot does the needed cache work only in the
>> path that launches linux that has been packaged as an image file (and
>> before launching vxworks I think).  For freebsd the needed cache ops
>> must be patched into two places, the bootelf path and the go path.
>>
>> -- Ian
>>
>> _______________________________________________
>> freebsd-arm at freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
>>
>
>


More information about the freebsd-arm mailing list