Similiar changes were made in bitrig by Patrick Wildt.
As part of this change the physical load address for imx and sunxi have
changed. Any u-boot settings that include it will need to be modified.
imx: 0x10800000 -> 0x10300000
sunxi: 0x40800000 -> 0x40300000
Tested by bmercer, canacar and myself.
ok bmercer@
-# $OpenBSD: Makefile,v 1.7 2013/11/01 20:35:52 jasper Exp $
+# $OpenBSD: Makefile,v 1.8 2015/05/19 00:05:59 jsg Exp $
REV= ${OSrev}
PID!= echo $$$$
KERNADDR_OMAP=0x80300000
-KERNADDR_IMX=0x10800000
-KERNADDR_SUNXI=0x40800000
+KERNADDR_IMX=0x10300000
+KERNADDR_SUNXI=0x40300000
DISKTYPE= rdroot
NBLKS= 10240
-# $OpenBSD: Makefile.inc,v 1.6 2015/01/26 01:55:55 jsg Exp $
+# $OpenBSD: Makefile.inc,v 1.7 2015/05/19 00:05:59 jsg Exp $
ALLSOC=IMX OMAP SUNXI
KERNELS=
.endfor
KERNADDR_OMAP=0x80300000
-KERNADDR_IMX=0x10800000
-KERNADDR_SUNXI=0x40800000
+KERNADDR_IMX=0x10300000
+KERNADDR_SUNXI=0x40300000
.for CONF K in ${KERNELS}
. if !target($K)
-/* $OpenBSD: armv7_machdep.c,v 1.22 2015/05/15 15:35:43 jsg Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.23 2015/05/19 00:05:59 jsg Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
void process_kernel_args(char *);
void parse_uboot_tags(void *);
void consinit(void);
+void bootconfig_dram(BootConfig *, psize_t *, psize_t *);
bs_protos(bs_notimpl);
#endif /* RAMDISK_HOOKS */
/* normally u-boot will set up bootconfig.dramblocks */
- platform_bootconfig_dram(&bootconfig, &memstart, &memsize);
+ bootconfig_dram(&bootconfig, &memstart, &memsize);
/*
* Set up the variables that define the availablilty of
#endif
}
}
+
+void
+bootconfig_dram(BootConfig *bootconfig, psize_t *memstart, psize_t *memsize)
+{
+ int loop;
+
+ if (bootconfig->dramblocks == 0)
+ panic("%s: dramblocks not set up!", __func__);
+
+ *memstart = bootconfig->dram[0].address;
+ *memsize = bootconfig->dram[0].pages * PAGE_SIZE;
+ printf("memory size derived from u-boot\n");
+ for (loop = 0; loop < bootconfig->dramblocks; loop++) {
+ printf("bootconf.mem[%d].address = %08x pages %d/0x%08x\n",
+ loop, bootconfig->dram[loop].address, bootconfig->dram[loop].pages,
+ bootconfig->dram[loop].pages * PAGE_SIZE);
+ }
+}
-/* $OpenBSD: armv7_machdep.h,v 1.2 2015/05/15 15:35:43 jsg Exp $ */
+/* $OpenBSD: armv7_machdep.h,v 1.3 2015/05/19 00:05:59 jsg Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
void platform_watchdog_reset(void);
void platform_init_cons(void);
const char *platform_board_name(void);
-void platform_bootconfig_dram(BootConfig *, psize_t *, psize_t *);
void platform_disable_l2_if_needed(void);
extern const char *platform_boot_name;
-# $OpenBSD: GENERIC-IMX,v 1.12 2015/04/16 09:09:49 mpi Exp $
+# $OpenBSD: GENERIC-IMX,v 1.13 2015/05/19 00:05:59 jsg Exp $
#
# GENERIC machine description file
#
machine armv7 arm
include "../../../conf/GENERIC"
-makeoptions KERNEL_BASE_PHYS="0x10800000"
-makeoptions KERNEL_BASE_VIRT="0xc0800000"
-options BUILD_STARTUP_PAGETABLE
-options STARTUP_PAGETABLE_ADDR=0x10200000
-options SDRAM_START="0x10000000"
+makeoptions KERNEL_BASE_PHYS="0x10300000"
+makeoptions KERNEL_BASE_VIRT="0xc0300000"
#options APERTURE
-# $OpenBSD: GENERIC-OMAP,v 1.15 2015/04/16 09:09:49 mpi Exp $
+# $OpenBSD: GENERIC-OMAP,v 1.16 2015/05/19 00:05:59 jsg Exp $
#
# GENERIC machine description file
#
makeoptions KERNEL_BASE_PHYS="0x80300000"
makeoptions KERNEL_BASE_VIRT="0xc0300000"
-options BUILD_STARTUP_PAGETABLE
-options STARTUP_PAGETABLE_ADDR=0x80200000
-options SDRAM_START="0x80000000"
option CONF_HAVE_GPIO
-# $OpenBSD: GENERIC-SUNXI,v 1.13 2015/04/16 09:09:49 mpi Exp $
+# $OpenBSD: GENERIC-SUNXI,v 1.14 2015/05/19 00:05:59 jsg Exp $
#
# GENERIC machine description file
#
machine armv7 arm
include "../../../conf/GENERIC"
-makeoptions KERNEL_BASE_PHYS="0x40800000"
-makeoptions KERNEL_BASE_VIRT="0xc0800000"
-options BUILD_STARTUP_PAGETABLE
-options STARTUP_PAGETABLE_ADDR=0x40200000
-options SDRAM_START="0x40000000"
+makeoptions KERNEL_BASE_PHYS="0x40300000"
+makeoptions KERNEL_BASE_VIRT="0xc0300000"
option CONF_HAVE_GPIO
-# $OpenBSD: Makefile.armv7,v 1.7 2015/01/13 01:12:49 deraadt Exp $
+# $OpenBSD: Makefile.armv7,v 1.8 2015/05/19 00:05:59 jsg Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
SYSTEM_LD_HEAD= @rm -f $@
SYSTEM_LD_HEAD+=; \
cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \
- sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \
- -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ldscript
+ sed -e 's/@KERNEL_BASE_PHYS@/0/' \
+ -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \
+ -e 's/(KERNEL_BASE_phys)/(KERNEL_BASE_virt)/' > ldscript
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS}
-# $OpenBSD: RAMDISK-IMX,v 1.14 2015/01/04 20:55:38 uaa Exp $
+# $OpenBSD: RAMDISK-IMX,v 1.15 2015/05/19 00:05:59 jsg Exp $
machine armv7 arm
maxusers 4
option INET6
option EXT2FS
-makeoptions KERNEL_BASE_PHYS="0x10800000"
-makeoptions KERNEL_BASE_VIRT="0xc0800000"
-option BUILD_STARTUP_PAGETABLE
-option STARTUP_PAGETABLE_ADDR=0x10200000
-option SDRAM_START="0x10000000"
+makeoptions KERNEL_BASE_PHYS="0x10300000"
+makeoptions KERNEL_BASE_VIRT="0xc0300000"
option CPU_ARMv7 # Support the ARMv7
config bsd root on rd0a swap on rd0b
-# $OpenBSD: RAMDISK-OMAP,v 1.11 2014/11/04 12:26:09 jsg Exp $
+# $OpenBSD: RAMDISK-OMAP,v 1.12 2015/05/19 00:05:59 jsg Exp $
machine armv7 arm
maxusers 4
makeoptions KERNEL_BASE_PHYS="0x80300000"
makeoptions KERNEL_BASE_VIRT="0xc0300000"
-option BUILD_STARTUP_PAGETABLE
-option STARTUP_PAGETABLE_ADDR=0x80200000
-option SDRAM_START="0x80000000"
option CPU_ARMv7 # Support the ARMv7
config bsd root on rd0a swap on rd0b
-# $OpenBSD: RAMDISK-SUNXI,v 1.12 2014/11/24 02:03:37 brad Exp $
+# $OpenBSD: RAMDISK-SUNXI,v 1.13 2015/05/19 00:05:59 jsg Exp $
machine armv7 arm
maxusers 4
option INET
option INET6
-makeoptions KERNEL_BASE_PHYS="0x40800000"
-makeoptions KERNEL_BASE_VIRT="0xc0800000"
-option BUILD_STARTUP_PAGETABLE
-option STARTUP_PAGETABLE_ADDR=0x40200000
-option SDRAM_START="0x40000000"
+makeoptions KERNEL_BASE_PHYS="0x40300000"
+makeoptions KERNEL_BASE_VIRT="0xc0300000"
option CPU_ARMv7 # Support the ARMv7
config bsd root on rd0a swap on rd0b
-/* $OpenBSD: imx_machdep.c,v 1.13 2015/05/15 15:35:43 jsg Exp $ */
+/* $OpenBSD: imx_machdep.c,v 1.14 2015/05/19 00:05:59 jsg Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
return (imx_board_name());
}
-void
-platform_bootconfig_dram(BootConfig *bootconfig, psize_t *memstart, psize_t *memsize)
-{
- if (bootconfig->dramblocks == 0) {
- *memstart = SDRAM_START;
- *memsize = 0x10000000; /* 256 MB */
- /* Fake bootconfig structure for the benefit of pmap.c */
- /* XXX must make the memory description h/w independant */
- bootconfig->dram[0].address = *memstart;
- bootconfig->dram[0].pages = *memsize / PAGE_SIZE;
- bootconfig->dramblocks = 1;
- } else {
- *memstart = bootconfig->dram[0].address;
- *memsize = bootconfig->dram[0].pages * PAGE_SIZE;
- }
-}
-
void
platform_disable_l2_if_needed(void)
{
-/* $OpenBSD: omap_machdep.c,v 1.4 2015/05/15 15:35:43 jsg Exp $ */
+/* $OpenBSD: omap_machdep.c,v 1.5 2015/05/19 00:05:59 jsg Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
return (omap_board_name());
}
-void
-platform_bootconfig_dram(BootConfig *bootconfig, psize_t *memstart, psize_t *memsize)
-{
- uint32_t sdrc_mcfg_0, sdrc_mcfg_1, memsize0, memsize1;
- int loop;
-
- if (bootconfig->dramblocks == 0) {
- sdrc_mcfg_0 = *(uint32_t *)0x6d000080;
- sdrc_mcfg_1 = *(uint32_t *)0x6d0000b0;
- memsize0 = (((sdrc_mcfg_0 >> 8))&0x3ff) * (2 * 1024 * 1024);
- memsize1 = (((sdrc_mcfg_1 >> 8))&0x3ff) * (2 * 1024 * 1024);
- *memsize = memsize0 + memsize1;
-
- *memstart = SDRAM_START;
- *memsize = 0x02000000; /* 32MB */
- /* Fake bootconfig structure for the benefit of pmap.c */
- /* XXX must make the memory description h/w independant */
- bootconfig->dram[0].address = *memstart;
- bootconfig->dram[0].pages = memsize0 / PAGE_SIZE;
- bootconfig->dramblocks = 1;
- if (memsize1 != 0) {
- bootconfig->dram[1].address = bootconfig->dram[0].address
- + memsize0; /* XXX */
- bootconfig->dram[1].pages = memsize1 / PAGE_SIZE;
- bootconfig->dramblocks++; /* both banks populated */
- }
- } else {
- /* doesn't deal with multiple segments, hopefully u-boot collaped them into one */
- *memstart = bootconfig->dram[0].address;
- *memsize = bootconfig->dram[0].pages * PAGE_SIZE;
- printf("memory size derived from u-boot\n");
- for (loop = 0; loop < bootconfig->dramblocks; loop++) {
- printf("bootconf.mem[%d].address = %08x pages %d/0x%08x\n",
- loop, bootconfig->dram[0].address, bootconfig->dram[0].pages,
- bootconfig->dram[0].pages * PAGE_SIZE);
- }
- }
-
-}
-
void
platform_disable_l2_if_needed(void)
{
-/* $OpenBSD: sunxi_machdep.c,v 1.6 2015/05/15 15:35:43 jsg Exp $ */
+/* $OpenBSD: sunxi_machdep.c,v 1.7 2015/05/19 00:05:59 jsg Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
return (sunxi_board_name());
}
-void
-platform_bootconfig_dram(BootConfig *bootconfig, psize_t *memstart, psize_t *memsize)
-{
- int loop;
-
- if (bootconfig->dramblocks == 0) {
- *memstart = SDRAM_START;
- *memsize = 0x10000000; /* 256 MB */
- /* Fake bootconfig structure for the benefit of pmap.c */
- /* XXX must make the memory description h/w independant */
- bootconfig->dram[0].address = *memstart;
- bootconfig->dram[0].pages = *memsize / PAGE_SIZE;
- bootconfig->dramblocks = 1;
- } else {
- *memstart = bootconfig->dram[0].address;
- *memsize = bootconfig->dram[0].pages * PAGE_SIZE;
- printf("memory size derived from u-boot\n");
- for (loop = 0; loop < bootconfig->dramblocks; loop++) {
- printf("bootconf.mem[%d].address = %08x pages %d/0x%08x\n",
- loop, bootconfig->dram[0].address, bootconfig->dram[0].pages,
- bootconfig->dram[0].pages * PAGE_SIZE);
- }
- }
-}
-
void
platform_disable_l2_if_needed(void)
{