CVS commit: src/sys/arch/evbarm/amlogic

2018-10-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 18 07:12:57 UTC 2018

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.24 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.25
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.24	Fri Sep 21 12:04:07 2018
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Thu Oct 18 07:12:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.24 2018/09/21 12:04:07 skrll Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.25 2018/10/18 07:12:57 skrll Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.24 2018/09/21 12:04:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.25 2018/10/18 07:12:57 skrll Exp $");
 
 #include "opt_console.h"
 #include "opt_machdep.h"
@@ -387,7 +387,7 @@ initarm(void *arg)
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 	if (ram_size > KERNEL_VM_BASE - KERNEL_BASE) {
 		printf("%s: dropping RAM size from %luMB to %uMB\n",
-		__func__, (unsigned long) (ram_size >> 20), 
+		__func__, (unsigned long) (ram_size >> 20),
 		(KERNEL_VM_BASE - KERNEL_BASE) >> 20);
 		ram_size = KERNEL_VM_BASE - KERNEL_BASE;
 	}



CVS commit: src/sys/arch/evbarm/amlogic

2015-03-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Mar  8 11:22:05 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
amlogic_reset: increase terminal_count to give uart sufficient time to flush 
any pending bytes before rebooting


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.14 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.15
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.14	Thu Mar  5 23:44:30 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Sun Mar  8 11:22:05 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.14 2015/03/05 23:44:30 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.15 2015/03/08 11:22: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.14 2015/03/05 23:44:30 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.15 2015/03/08 11:22:05 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -485,7 +485,7 @@ amlogic_reset(void)
 	bus_size_t off = AMLOGIC_CBUS_OFFSET;
 
 	bus_space_write_4(bst, bsh, off + WATCHDOG_TC_REG,
-	WATCHDOG_TC_CPUS | WATCHDOG_TC_ENABLE | 1);
+	WATCHDOG_TC_CPUS | WATCHDOG_TC_ENABLE | 0xfff);
 	bus_space_write_4(bst, bsh, off + WATCHDOG_RESET_REG, 0);
 
 	for (;;) {



CVS commit: src/sys/arch/evbarm/amlogic

2015-03-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Mar  5 23:44:30 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
initialize amlogic cpufreq sysctls


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.13 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.14
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.13	Wed Mar  4 23:52:54 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Thu Mar  5 23:44:30 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.13 2015/03/04 23:52:54 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.14 2015/03/05 23:44:30 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.13 2015/03/04 23:52:54 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.14 2015/03/05 23:44:30 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -505,6 +505,10 @@ amlogic_device_register(device_t self, v
 		return;
 	}
 
+	if (device_is_a(self, cpu)  device_unit(self) == 0) {
+		amlogic_cpufreq_init();
+	}
+
 	/*
 	 * We need to tell the A9 Global/Watchdog Timer
 	 * what frequency it runs at.



CVS commit: src/sys/arch/evbarm/amlogic

2015-03-04 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Mar  4 23:52:54 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
Support for passing mac address from u-boot to the kernel with the
awge0.mac-address cmdline option.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.12 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.13
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.12	Tue Mar  3 23:20:04 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Wed Mar  4 23:52:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.12 2015/03/03 23:20:04 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.13 2015/03/04 23:52:54 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.12 2015/03/03 23:20:04 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.13 2015/03/04 23:52:54 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -524,6 +524,17 @@ amlogic_device_register(device_t self, v
 		 */
 		prop_dictionary_set_uint32(dict, offset, 0xfff0);
 	}
+
+	if (device_is_a(self, awge)  device_unit(self) == 0) {
+		uint8_t enaddr[ETHER_ADDR_LEN];
+		if (get_bootconf_option(boot_args, awge0.mac-address,
+		BOOTOPT_TYPE_MACADDR, enaddr)) {
+			prop_data_t pd = prop_data_create_data(enaddr,
+			sizeof(enaddr));
+			prop_dictionary_set(dict, mac-address, pd);
+			prop_object_release(pd);
+		}
+	}
 }
 
 #if defined(MULTIPROCESSOR)



CVS commit: src/sys/arch/evbarm/amlogic

2015-03-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Mar  3 23:20:04 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
fix build without VERBOSE_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.11 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.12
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.11	Tue Mar  3 23:14:41 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Tue Mar  3 23:20:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.11 2015/03/03 23:14:41 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.12 2015/03/03 23:20:04 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.11 2015/03/03 23:14:41 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.12 2015/03/03 23:20:04 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -633,12 +633,5 @@ amlogic_mpinit(uint32_t mpinit_vec)
 		if (arm_cpu_hatched == hatched)
 			break;
 	}
-
-	if (i == 0) {
-		const char *msg = \nWARNING: Some APs failed to start\n;
-		const char *p = msg;
-		while (*p)
-			amlogic_putchar(*p++);
-	}
 }
 #endif



CVS commit: src/sys/arch/evbarm/amlogic

2015-03-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Mar  3 23:14:41 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
cleanup, copy in boot args from uboot


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.10 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.11
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.10	Sun Mar  1 15:37:26 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Tue Mar  3 23:14:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.10 2015/03/01 15:37:26 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.11 2015/03/03 23:14:41 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,25 +125,17 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.10 2015/03/01 15:37:26 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.11 2015/03/03 23:14:41 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
-#include opt_kgdb.h
-#include opt_ipkdb.h
 #include opt_md.h
 #include opt_amlogic.h
 #include opt_arm_debug.h
 #include opt_multiprocessor.h
 
 #include amlogic_com.h
-#if 0
-#include prcm.h
-#include sdhc.h
-#include ukbd.h
-#endif
 #include arml2cc.h
-#include act8846pm.h
 #include ether.h
 
 #include sys/param.h
@@ -170,9 +162,6 @@ __KERNEL_RCSID(0, $NetBSD: amlogic_mach
 #include machine/db_machdep.h
 #include ddb/db_sym.h
 #include ddb/db_extern.h
-#ifdef KGDB
-#include sys/kgdb.h
-#endif
 
 #include machine/bootconfig.h
 #include arm/armreg.h
@@ -198,9 +187,6 @@ __KERNEL_RCSID(0, $NetBSD: amlogic_mach
 #include evbarm/include/autoconf.h
 #include evbarm/amlogic/platform.h
 
-#include dev/i2c/i2cvar.h
-#include dev/i2c/ddcreg.h
-
 #include dev/usb/ukbdvar.h
 #include net/if_ether.h
 
@@ -212,9 +198,6 @@ BootConfig bootconfig;		/* Boot config s
 static char bootargs[AMLOGIC_MAX_BOOT_STRING];
 char *boot_args = NULL;
 char *boot_file = NULL;
-#if 0
-static uint8_t amlogic_edid[128];	/* EDID storage */
-#endif
 u_int uboot_args[4] = { 0 };	/* filled in by amlogic_start.S (not in bss) */
 
 /* Same things, but for the free (unused by the kernel) memory. */
@@ -231,11 +214,7 @@ extern char _end[];
 /* Prototypes */
 
 void consinit(void);
-#ifdef KGDB
-static void kgdb_port_init(void);
-#endif
 
-static void init_clocks(void);
 static void amlogic_device_register(device_t, void *);
 static void amlogic_reset(void);
 
@@ -281,8 +260,8 @@ amlogic_db_trap(int where)
 }
 #endif
 
-void amlogic_putchar(char c);
-void
+#ifdef VERBOSE_INIT_ARM
+static void
 amlogic_putchar(char c)
 {
 	volatile uint32_t *uartaddr = (volatile uint32_t *)CONSADDR_VA;
@@ -300,6 +279,19 @@ amlogic_putchar(char c)
 			break;
 	}
 }
+static void
+amlogic_putstr(const char *s)
+{
+	for (const char *p = s; *p; p++) {
+		amlogic_putchar(*p);
+	}
+}
+#define DPRINTF(...)		printf(__VA_ARGS__)
+#define DPRINT(x)		amlogic_putstr(x)
+#else
+#define DPRINTF(...)
+#define DPRINT(x)
+#endif
 
 static psize_t
 amlogic_get_ram_size(void)
@@ -326,17 +318,16 @@ u_int
 initarm(void *arg)
 {
 	psize_t ram_size = 0;
-	*(volatile int *)CONSADDR_VA  = 0x40;	/* output '@' */
+	DPRINT(initarm:);
 
-	amlogic_putchar('d');
+	DPRINT( devmap);
 	pmap_devmap_register(devmap);
 
-	amlogic_putchar('b');
+	DPRINT( bootstrap);
 	amlogic_bootstrap();
 
-	amlogic_putchar('!');
-
 #ifdef MULTIPROCESSOR
+	DPRINT( ncpu);
 	const bus_addr_t cbar = armreg_cbar_read();
 	if (cbar) {
 		const bus_space_handle_t scu_bsh =
@@ -349,50 +340,42 @@ initarm(void *arg)
 #endif
 
 	/* Heads up ... Setup the CPU / MMU / TLB functions. */
+	DPRINT( cpufunc);
 	if (set_cpufuncs())
 		panic(cpu not recognized!);
 
-	init_clocks();
-
+	DPRINT( consinit);
 	consinit();
 
 #if NARML2CC  0
 /*
  * Probe the PL310 L2CC
  */
-	printf(probe the PL310 L2CC\n);
+	DPRINTF( l2cc);
 const bus_space_handle_t pl310_bh =
 AMLOGIC_CORE_VBASE + AMLOGIC_PL310_OFFSET;
 arml2cc_init(amlogic_bs_tag, pl310_bh, 0);
-amlogic_putchar('l');
 #endif
 
-	printf(\nuboot arg = %#x, %#x, %#x, %#x\n,
-	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
+	DPRINTF( cbar=%#x, armreg_cbar_read());
 
-#ifdef KGDB
-	kgdb_port_init();
-#endif
+	DPRINTF( ok\n);
+
+	DPRINTF(uboot: args %#x, %#x, %#x, %#x\n,
+	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
 
 	cpu_reset_address = amlogic_reset;
 
-#ifdef VERBOSE_INIT_ARM
 	/* Talk to the user */
-	printf(\nNetBSD/evbarm (amlogic) booting ...\n);
-#endif
+	DPRINTF(\nNetBSD/evbarm (amlogic) booting ...\n);
 
 #ifdef BOOT_ARGS
 	char mi_bootargs[] = BOOT_ARGS;
 	parse_mi_bootargs(mi_bootargs);
 #endif
 
-#ifdef 

CVS commit: src/sys/arch/evbarm/amlogic

2015-02-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 28 15:21:07 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
set correct a9tmr/a9wdt frequency


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.6 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.7
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.6	Fri Feb 27 21:13:52 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Sat Feb 28 15:21:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.6 2015/02/27 21:13:52 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.7 2015/02/28 15:21:07 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.6 2015/02/27 21:13:52 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.7 2015/02/28 15:21:07 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -558,7 +558,7 @@ amlogic_device_register(device_t self, v
 	 */
 	if (device_is_a(self, a9tmr) || device_is_a(self, a9wdt)) {
 prop_dictionary_set_uint32(dict, frequency,
-		16 / 2);
+		amlogic_get_rate_a9periph());
 
 		return;
 	}



CVS commit: src/sys/arch/evbarm/amlogic

2015-02-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 28 18:50:15 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
access watchdog with AMLOGIC_CBUS_OFFSET offset


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.7 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.8
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.7	Sat Feb 28 15:21:07 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Sat Feb 28 18:50:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.7 2015/02/28 15:21:07 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.8 2015/02/28 18:50:15 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.7 2015/02/28 15:21:07 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.8 2015/02/28 18:50:15 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -492,11 +492,12 @@ void
 amlogic_reset(void)
 {
 	bus_space_tag_t bst = amlogic_bs_tag;
-bus_space_handle_t bsh = amlogic_core_bsh;
+	bus_space_handle_t bsh = amlogic_core_bsh;
+	bus_size_t off = AMLOGIC_CBUS_OFFSET;
 
-	bus_space_write_4(bst, bsh, WATCHDOG_TC_REG,
+	bus_space_write_4(bst, bsh, off + WATCHDOG_TC_REG,
 	WATCHDOG_TC_CPUS | WATCHDOG_TC_ENABLE | 1);
-	bus_space_write_4(bst, bsh, WATCHDOG_RESET_REG, 0);
+	bus_space_write_4(bst, bsh, off + WATCHDOG_RESET_REG, 0);
 
 	for (;;) {
 		__asm(wfi);



CVS commit: src/sys/arch/evbarm/amlogic

2015-02-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Feb 27 18:00:29 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
use va not pa for console bsh


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.2 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.3
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.2	Fri Feb 27 17:35:08 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Fri Feb 27 18:00:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.2 2015/02/27 17:35:08 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.3 2015/02/27 18:00:29 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.2 2015/02/27 17:35:08 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.3 2015/02/27 18:00:29 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -470,9 +470,6 @@ static const int conmode = CONMODE;
 void
 consinit(void)
 {
-#if NAMLOGIC_COM  0
-	bus_space_handle_t bsh;
-#endif
 	static int consinit_called = 0;
 
 	if (consinit_called != 0)
@@ -483,9 +480,9 @@ consinit(void)
 	amlogic_putchar('e');
 
 #if NAMLOGIC_COM  0
-	bus_space_subregion(amlogic_bs_tag, amlogic_core_bsh,
-	consaddr - AMLOGIC_CORE_BASE, AMLOGIC_UART_SIZE, bsh);
-	amlogic_com_cnattach(amlogic_bs_tag, consaddr, conspeed, conmode);
+const bus_space_handle_t bsh =
+AMLOGIC_CORE_VBASE + (consaddr - AMLOGIC_CORE_BASE);
+	amlogic_com_cnattach(amlogic_bs_tag, bsh, conspeed, conmode);
 #endif
 
 #if NUKBD  0



CVS commit: src/sys/arch/evbarm/amlogic

2015-02-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Feb 27 20:41:01 UTC 2015

Modified Files:
src/sys/arch/evbarm/amlogic: amlogic_machdep.c

Log Message:
pass external pl310 offset to arml2cc with device_register


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/amlogic/amlogic_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/amlogic/amlogic_machdep.c
diff -u src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.4 src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.5
--- src/sys/arch/evbarm/amlogic/amlogic_machdep.c:1.4	Fri Feb 27 19:57:10 2015
+++ src/sys/arch/evbarm/amlogic/amlogic_machdep.c	Fri Feb 27 20:41:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amlogic_machdep.c,v 1.4 2015/02/27 19:57:10 jmcneill Exp $ */
+/*	$NetBSD: amlogic_machdep.c,v 1.5 2015/02/27 20:41:01 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.4 2015/02/27 19:57:10 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: amlogic_machdep.c,v 1.5 2015/02/27 20:41:01 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -561,4 +561,13 @@ amlogic_device_register(device_t self, v
 
 		return;
 	}
+
+	if (device_is_a(self, arml2cc)) {
+		/*
+		 * L2 cache regs are at C420 and A9 periph base is
+		 * at C430; pass as a negative offset for the benefit
+		 * of armperiph bus.
+		 */
+		prop_dictionary_set_uint32(dict, offset, 0xfff0);
+	}
 }