Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patch for BeagleBone Black boot arguments



On Jul 30, 2013, at 1:26 PM, Dennis Ferguson 
<dennis.c.ferguson%gmail.com@localhost> wrote:

> Boot arguments passed from U-Boot don't currently make it into a NetBSD
> kernel.  The reason seems to be a sanity check on the address passed
> from u-boot which is inappropriate for the BB Black, which has twice as
> much memory as the BB.
> 
> This fixes it by doubling the acceptable address range.  With the patch
> booting with `setenv bootargs root=ld0a' in the u-boot configuration allows
> a generic kernel to boot without asking.
> 
> RCS file: /cvsroot/src/sys/arch/evbarm/beagle/beagle_machdep.c,v
> retrieving revision 1.52
> diff -u -r1.52 beagle_machdep.c
> --- sys/arch/evbarm/beagle/beagle_machdep.c     29 Jun 2013 20:44:52 -0000    
>   1.52
> +++ sys/arch/evbarm/beagle/beagle_machdep.c     30 Jul 2013 20:17:17 -0000
> @@ -563,7 +563,7 @@
>            mapallmem_p);
> 
>        /* "bootargs" env variable is passed as 4th argument to kernel */
> -       if ((uboot_args[3] & 0xf0000000) == 0x80000000) {
> +       if ((uboot_args[3] & 0xe0000000) == 0x80000000) {
>                strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
>        }
>        boot_args = bootargs;

I thought about it for a while and realized that wasn't right either.

@@ -562,10 +562,12 @@ initarm(void *arg)
        arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, devmap,
            mapallmem_p);
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
        /* "bootargs" env variable is passed as 4th argument to kernel */
-       if ((uboot_args[3] & 0xe0000000) == 0x80000000) {
+       if (uboot_args[3] - 0x80000000 < ram_size) {
                strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
        }
+#endif
        boot_args = bootargs;
        parse_mi_bootargs(boot_args);
 



Home | Main Index | Thread Index | Old Index