Porting FreeBSD to Atmel at91sam9263

K Staring qdk at quickdekay.net
Mon Mar 31 09:02:41 PDT 2008


Hi,

I'm trying to get FreeBSD to boot from an Atmel 9263 based board.
I suppose the porting process isn't that much trouble, as the Atmel 9261 
seems to be supported. The bootloader used is u-boot.

As far as I can see, the Atmel 9263 is mostly identical to the 9261, but 
the memory mapping of the integrated devices differ. So to start with, I 
created an extra hints file with the correct offsets for the devices 
(and use that hints file in the kernel conf).

This clearly wasn't enough; I didn't get any output. Next, I tried 
compiling some simple code, like printing a character to the USB serial 
device (offset 0xffffee00 + 28) and jumping to 0x0 to reboot. This 
worked ok.

Using the jump-to-0x0 trick (ldr r0, =0 ; mov pc, r0) I was able to boot 
and reboot the kernel up to the mmu enable code at Lunmapped: in 
locore.S (STARTUP_PAGETABLE_ADDR is defined). After this point, the 
board didn't reboot. Which is understandable since the mmu won't allow 
it. However, adding this line at the start of mmu_init_table didn't 
improve anything, the board still doesn't seem to reboot.

         MMU_INIT(0x0, 0x0 , 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))

Another possibility is that u-boot doens't expect the mmu to be active 
and causes a protection fault itself.

Can anyone give me pointers for possible next steps to try? It looks 
like the hints files isn't used by some of the code in the at91 
directory, is this correct? Would editing at91rm92reg.h be more useful? 
I'm using FreeBSD 8.


Thanks for any advice,

Khamba

-- (src/sys/arm/at91/std.a9263)
include "../at91/std.at91"
files   "../at91/files.kb920x"

makeoptions     KERNPHYSADDR=0x20000000
makeoptions     KERNVIRTADDR=0xc0000000
options         KERNPHYSADDR=0x20000000
options         KERNVIRTADDR=0xc0000000
options         STARTUP_PAGETABLE_ADDR=0x20800000
options         PHYSADDR=0x20000000
--

-- (boot with u-boot)
tftp 20000000 kernel
go 200000e0
--
-------------- next part --------------
# These are the wiring for the at91sam9263.  These are the built-in devices
# for that cpu.

# DBGU is unit 0
hint.uart.0.at="apb"
hint.uart.0.maddr="0xffffee00"
hint.uart.0.flags=0x10
# USART0 is unit 1
hint.uart.1.at="apb"
hint.uart.1.maddr="0xfff8c000"
# USART1 is unit 2
hint.uart.2.at="apb"
hint.uart.2.maddr="0xfff90000"
# USART2 is unit 3
hint.uart.3.at="apb"
hint.uart.3.maddr="0xfff94000"
# SSC0 is unit 4
hint.uart.4.at="apb"
hint.uart.4.maddr="0xfff98000"
# SSC1 is unit 5
hint.uart.5.at="apb"
hint.uart.5.maddr="0xfff9c000"

# TC0, TC1, TC2
hint.tc.0.at="apb"
hint.tc.0.maddr="0xfff7c000"

# USB Device
hint.udp.0.at="apb"
hint.udp.0.maddr="0xfff78000"

# MCI0
hint.mci.0.at="apb"
hint.mci.0.maddr="0xfff80000"
# MCI1
hint.mci.1.at="apb"
hint.mci.1.maddr="0xfff84000"

# TWI
hint.twi.0.at="apb"
hint.twi.0.maddr="0xfff88000"

# SSC0
hint.ssc.0.at="apb"
hint.ssc.0.maddr="0xfff98000"
# SSC1
hint.ssc.1.at="apb"
hint.ssc.1.maddr="0xfff9c000"

# SPI0
hint.spi.0.at="apb"
hint.spi.0.maddr="0xfffa4000"
# SSC1
hint.spi.1.at="apb"
hint.spi.1.maddr="0xfff9c000"

# PMC
hint.pmc.0.at="apb"
hint.pmc.0.maddr="0xfffffc00"

# USB host (ohci)
#??? maybe this needs to be on asb instead of apb
hint.ohci.at="apb"
hint.ohci.maddr="0x00500000"
# LCD controller
hint.atlcd.at="apb"
hint.atlcd.maddr="0x00600000"


More information about the freebsd-arm mailing list