diff options
author | ian <ian@FreeBSD.org> | 2016-01-15 18:27:34 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2016-01-15 18:27:34 +0000 |
commit | 60d3f112d9185ce3c85a9103d6b067ac21e1dfc8 (patch) | |
tree | 6a33166b265df2cfe8fe8c8737303d0905bc2677 | |
parent | 4d126fab0e77c1c35e8cf7ba9e273fff6b235e6f (diff) | |
download | FreeBSD-src-60d3f112d9185ce3c85a9103d6b067ac21e1dfc8.zip FreeBSD-src-60d3f112d9185ce3c85a9103d6b067ac21e1dfc8.tar.gz |
Reduce diffs to upstream by adding a couple comment blocks and moving the
parse_boot_param() function to the end of the file.
-rw-r--r-- | sys/arm/at91/board_tsc4370.c | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/sys/arm/at91/board_tsc4370.c b/sys/arm/at91/board_tsc4370.c index c898518..1bc0426 100644 --- a/sys/arm/at91/board_tsc4370.c +++ b/sys/arm/at91/board_tsc4370.c @@ -70,6 +70,10 @@ WR4HW(uint32_t devbase, uint32_t regoff, uint32_t val) *(volatile uint32_t *)(AT91_BASE + devbase + regoff) = val; } +/* + * This is the same calculation the at91 uart driver does, we use it to update + * the console uart baud rate after changing the MCK rate. + */ #ifndef BAUD2DIVISOR #define BAUD2DIVISOR(b) \ ((((at91_master_clock * 10) / ((b) * 16)) + 5) / 10) @@ -96,34 +100,6 @@ static struct arm_boot_params boot_params; static struct tsc_bootinfo inkernel_bootinfo; /* - * Override the default boot param parser (supplied via weak linkage) with one - * that knows how to handle our custom tsc_bootinfo passed in from boot2. - */ -vm_offset_t -parse_boot_param(struct arm_boot_params *abp) -{ - - boot_params = *abp; - - /* - * If the right magic is in r0 and a non-NULL pointer is in r1, then - * it's our bootinfo, copy it. The pointer in r1 is a physical address - * passed from boot2. This routine is called immediately upon entry to - * initarm() and is in very nearly the same environment as boot2. In - * particular, va=pa and we can safely copy the args before we lose easy - * access to the memory they're stashed in right now. - * - * Note that all versions of boot2 that we've ever shipped have put - * zeroes into r2 and r3. Maybe that'll be useful some day. - */ - if (abp->abp_r0 == TSC_BOOTINFO_MAGIC && abp->abp_r1 != 0) { - inkernel_bootinfo = *(struct tsc_bootinfo *)(abp->abp_r1); - } - - return fake_preload_metadata(abp); -} - -/* * Change the master clock config and wait for it to stabilize. */ static void @@ -516,6 +492,8 @@ board_init(void) */ master_clock_init(); + /* From this point on you can use printf. */ + /* * Configure UARTs. */ @@ -598,5 +576,33 @@ board_init(void) return (at91_ramsize()); } +/* + * Override the default boot param parser (supplied via weak linkage) with one + * that knows how to handle our custom tsc_bootinfo passed in from boot2. + */ +vm_offset_t +parse_boot_param(struct arm_boot_params *abp) +{ + + boot_params = *abp; + + /* + * If the right magic is in r0 and a non-NULL pointer is in r1, then + * it's our bootinfo, copy it. The pointer in r1 is a physical address + * passed from boot2. This routine is called immediately upon entry to + * initarm() and is in very nearly the same environment as boot2. In + * particular, va=pa and we can safely copy the args before we lose easy + * access to the memory they're stashed in right now. + * + * Note that all versions of boot2 that we've ever shipped have put + * zeroes into r2 and r3. Maybe that'll be useful some day. + */ + if (abp->abp_r0 == TSC_BOOTINFO_MAGIC && abp->abp_r1 != 0) { + inkernel_bootinfo = *(struct tsc_bootinfo *)(abp->abp_r1); + } + + return fake_preload_metadata(abp); +} + ARM_BOARD(NONE, "TSC4370 Controller Board"); |