From 60d3f112d9185ce3c85a9103d6b067ac21e1dfc8 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 15 Jan 2016 18:27:34 +0000 Subject: [PATCH] Reduce diffs to upstream by adding a couple comment blocks and moving the parse_boot_param() function to the end of the file. --- sys/arm/at91/board_tsc4370.c | 62 ++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/sys/arm/at91/board_tsc4370.c b/sys/arm/at91/board_tsc4370.c index c898518623fb..1bc0426878ba 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) @@ -95,34 +99,6 @@ struct tsc_bootinfo { 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. */ @@ -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");