Patch from http://people.FreeBSD.org/~cognet/

M. Warner Losh imp at bsdimp.com
Mon Mar 12 18:43:46 UTC 2007


In message: <66aac5180703121126x66878bb1ub819ed5b4b7262e2 at mail.gmail.com>
            ",LN`XY ,L1c`PZ" <jack.avenger at gmail.com> writes:
: avenger# make TARGET=arm TARGET_ARCH=arm buildenv
: #cd /usr/src/sys/boot/arm/at91
: # make
: ===> libat91 (all)
: Warning: Object directory not changed from original
: /usr/src/sys/boot/arm/at91/libat91
: cc -Os -mcpu=arm9 -ffreestanding
: -I/usr/src/sys/boot/arm/at91/libat91/../libat9
: 1  -I/usr/src/sys/boot/arm/at91/libat91/../../../..
: -I/usr/src/sys/boot/arm/at9
: 1/libat91/../../../../arm  -D_KERNEL  -Wall -Waggregate-return
: -Wnested-extern
: s  -Wpointer-arith -Wshadow -Wwrite-strings  -Werror  -Wmissing-prototypes
: -Wmi
: ssing-declarations -DBOOT_KB920X  -c printf.c
: printf.c:20:20: stdarg.h: No such file or directory

That should be found.  I assume you have a full src tree, right?  I'm
on travel today, but I'll see if I can recreate it tomorrow when in
the office.  Since you can build a kernel, I assume you've done a
buildworld, right?

: Also I can`t boot kernel. I have u-boot on my board so i just do next steps:

: ## Starting application at 0x20000000 ...
: =11v!F=n

This almost certaily is a wrong baud rate problem.  I believe that
this may be the result of the following #define:

at91rm92reg.h:#define AT91C_MASTER_CLOCK        60000000

which the uart uses to get the RCLK to generate characters.  If the
uboot loader doesn't setup the master clock to be 60MHz, then there
will be problems.  It there some way that you can verify that it is
doing this?  I think that might be the problem here.  There may also
be some assumptions about the xtal frequency that is causing problems
too.  Look for this in at91_pmc.c:

static int
at91_pmc_attach(device_t dev)
{
        int err;
         
        pmc_softc = device_get_softc(dev);
        pmc_softc->dev = dev;
        if ((err = at91_pmc_activate(dev)) != 0)
                return err;
#if defined(AT91_TSC) | defined (AT91_BWCT)
        at91_pmc_init_clock(pmc_softc, 16000000);
#else
        at91_pmc_init_clock(pmc_softc, 10000000);
#endif
         
        return (0);
}

There really needs to be better info passed from the boot blocks to
the kernel (or we need to recognize the state better) to prevent
issues like this.

: So I have next questions:
: 1. Is kernel right compiled?

It looks ok to me...

: 2. Can u-boot used to load freebsd kernel, and how do this?

I think the way you did it.

Warner


More information about the freebsd-arm mailing list