Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Pass boot device to amlogicsdhc and amlogicsdio dri...
details: https://anonhg.NetBSD.org/src/rev/67752a1048e9
branches: trunk
changeset: 339756:67752a1048e9
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Aug 08 13:54:05 2015 +0000
description:
Pass boot device to amlogicsdhc and amlogicsdio drivers.
diffstat:
sys/arch/arm/amlogic/amlogic_reg.h | 3 ++-
sys/arch/evbarm/amlogic/amlogic_machdep.c | 20 ++++++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
diffs (65 lines):
diff -r 6e44aef34a58 -r 67752a1048e9 sys/arch/arm/amlogic/amlogic_reg.h
--- a/sys/arch/arm/amlogic/amlogic_reg.h Sat Aug 08 12:34:33 2015 +0000
+++ b/sys/arch/arm/amlogic/amlogic_reg.h Sat Aug 08 13:54:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_reg.h,v 1.11 2015/04/25 14:41:33 jmcneill Exp $ */
+/* $NetBSD: amlogic_reg.h,v 1.12 2015/08/08 13:54:05 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -87,6 +87,7 @@
#define AMLOGIC_SRAM_OFFSET 0x19000000
+#define AMLOGIC_BOOTINFO_OFFSET 0x1901ff00
#define AMLOGIC_CPUCONF_OFFSET 0x1901ff80
#define AMLOGIC_CBUS_CPU_CLK_CNTL_REG 0x419c
diff -r 6e44aef34a58 -r 67752a1048e9 sys/arch/evbarm/amlogic/amlogic_machdep.c
--- a/sys/arch/evbarm/amlogic/amlogic_machdep.c Sat Aug 08 12:34:33 2015 +0000
+++ b/sys/arch/evbarm/amlogic/amlogic_machdep.c Sat Aug 08 13:54:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_machdep.c,v 1.20 2015/04/03 18:03:05 jmcneill Exp $ */
+/* $NetBSD: amlogic_machdep.c,v 1.21 2015/08/08 13:54:05 jmcneill Exp $ */
/*
* Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.20 2015/04/03 18:03:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.21 2015/08/08 13:54:05 jmcneill Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@@ -495,6 +495,16 @@
}
}
+static uint32_t
+amlogic_get_boot_device(void)
+{
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
+ bus_space_handle_t bsh = amlogic_core_bsh;
+ bus_size_t off = AMLOGIC_BOOTINFO_OFFSET;
+
+ return bus_space_read_4(bst, bsh, off + 4);
+}
+
void
amlogic_device_register(device_t self, void *aux)
{
@@ -542,6 +552,12 @@
}
}
+ if (device_is_a(self, "amlogicsdhc") ||
+ device_is_a(self, "amlogicsdio")) {
+ prop_dictionary_set_uint32(dict, "boot_id",
+ amlogic_get_boot_device());
+ }
+
#if NGENFB > 0
if (device_is_a(self, "genfb")) {
char *ptr;
Home |
Main Index |
Thread Index |
Old Index