CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: tnn Date: Sun Aug 20 14:52:36 UTC 2017 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: BPI has no programmable current limiters for the USB host, just a PCB fuse To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.49 src/sys/arch/evbarm/awin/awin_machdep.c:1.50 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.49 Thu Oct 20 09:53:07 2016 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Aug 20 14:52:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.49 2016/10/20 09:53:07 skrll Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.50 2017/08/20 14:52:36 tnn Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.49 2016/10/20 09:53:07 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.50 2017/08/20 14:52:36 tnn Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -722,12 +722,14 @@ awin_device_register(device_t self, void } else { prop_dictionary_set_cstring(dict, "usb0drv", ">PB2"); } +#if AWIN_board != AWIN_bpi + prop_dictionary_set_cstring(dict, "usb1drv", ">PH6"); prop_dictionary_set_cstring(dict, "usb2drv", ">PH3"); +#endif prop_dictionary_set_cstring(dict, "usb0iddet", (cubietruck_p ? "PH6"); #endif #if AWIN_board == AWIN_cubietruck prop_dictionary_set_cstring(dict, "usb0restrict", ">PH0");
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: chs Date: Wed Jul 5 23:04:09 UTC 2017 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: in the awin_start startup code, set up a tiny stack in case a C function wants to use it. in the various *_mpinit functions, avoid using caller-saved registers since these call C functions. these changes allow -fno-omit-frame-pointer to work. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.13 src/sys/arch/evbarm/awin/awin_start.S:1.14 --- src/sys/arch/evbarm/awin/awin_start.S:1.13 Mon Dec 26 13:28:59 2016 +++ src/sys/arch/evbarm/awin/awin_start.S Wed Jul 5 23:04:09 2017 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.13 2016/12/26 13:28:59 rjs Exp $") +RCSID("$NetBSD: awin_start.S,v 1.14 2017/07/05 23:04:09 chs Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -170,6 +170,10 @@ _C_LABEL(awin_start): #endif lsr r1, r1, #16 + /* Set up a small stack in case gtmr_bootdelay() wants it */ + movw sp, #:lower16:awin_initstkbase + movt sp, #:upper16:awin_initstkbase + // MP init based on SoC ID #if defined(ALLWINNER_A20) # if defined(ALLWINNER_A31) @@ -209,6 +213,13 @@ _C_LABEL(awin_start): .popsection #endif + .pushsection .bss + .align 8 +awin_initstk: + .space 32 +awin_initstkbase: + .popsection + #include #if defined(MULTIPROCESSOR) @@ -323,11 +334,11 @@ a31_mpinit: setend le // everything here is little-endian #endif - mov r12, #1 // CPU number + mov r10, #1 // CPU number a31_mpinit_cpu: - add r1, r12, #'0' + add r1, r10, #'0' XPUTC2(r1) /* Set where the other CPU(s) are going to execute */ @@ -339,7 +350,7 @@ a31_mpinit_cpu: /* Assert CPU core reset */ mov r1, #0 mov r2, #0x40 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A31_CPUCFG_CPU0_RST_CTRL_REG str r1, [r5, r7] dsb @@ -347,7 +358,7 @@ a31_mpinit_cpu: /* Ensure CPUX reset also invalidates its L1 caches */ ldr r1, [r5, #AWIN_CPUCFG_GENCTRL_REG] mov r0, #1 - lsl r0, r0, r12 + lsl r0, r0, r10 bic r1, r1, r0 str r1, [r5, #AWIN_CPUCFG_GENCTRL_REG] dsb @@ -355,13 +366,13 @@ a31_mpinit_cpu: /* Release power clamp */ mov r1, #0xe7 mov r2, #0x4 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A31_PRCM_CPUX_PWR_CLAMP_REG str r1, [r6, r7] dsb mov r2, #0x40 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A31_CPUCFG_CPU0_PWR_CLAMP_STATUS_REG 1: ldr r1, [r5, r7] @@ -375,13 +386,13 @@ a31_mpinit_cpu: /* Restore power clamp */ mov r1, #0 mov r2, #0x4 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A31_PRCM_CPUX_PWR_CLAMP_REG str r1, [r6, r7] dsb mov r2, #0x40 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A31_CPUCFG_CPU0_PWR_CLAMP_STATUS_REG 1: ldr r1, [r5, r7] @@ -395,7 +406,7 @@ a31_mpinit_cpu: /* Clear power-off gating */ ldr r1, [r6, #AWIN_A31_PRCM_PWROFF_GATING_REG] mov r0, #1 - lsl r0, r0, r12 + lsl r0, r0, r10 bic r1, r1, r0 str r1, [r6, #AWIN_A31_PRCM_PWROFF_GATING_REG] dsb @@ -407,14 +418,14 @@ a31_mpinit_cpu: /* Bring CPUX out of reset */ mov r1, #(AWIN_A31_CPUCFG_RST_CTRL_CPU_RESET|AWIN_A31_CPUCFG_RST_CTRL_CORE_RESET) mov r2, #0x40 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A31_CPUCFG_CPU0_RST_CTRL_REG str r1, [r5, r7] dsb /* If there is another CPU, start it */ - add r12, r12, #1 - cmp r12, #3 + add r10, r10, #1 + cmp r10, #3 ble a31_mpinit_cpu #ifdef __ARMEB__ @@ -462,11 +473,11 @@ a80_mpinit: setend le // everything here is little-endian #endif - mov r12, #1 // CPU number + mov r10, #1 // CPU number a80_mpinit_cpu: - add r1, r12, #'0' + add r1, r10, #'0' XPUTC2(r1) /* Set where the other CPU(s) are going to execute */ @@ -478,27 +489,27 @@ a80_mpinit_cpu: /* Assert CPU power on reset */ ldr r1, [r6, #AWIN_A80_RPRCM_CLUSTER0_RST_REG] mov r0, #1 - lsl r0, r0, r12 + lsl r0, r0, r10 bic r1, r1, r0 str r1, [r6, #AWIN_A80_RPRCM_CLUSTER0_RST_REG] /* Assert CPU core reset */ ldr r1, [r5, #AWIN_A80_RCPUCFG_CLUSTER0_RST_REG] mov r0, #1 - lsl r0, r0, r12 + lsl r0, r0, r10 bic r1, r1, r0 str r1, [r5, #AWIN_A80_RCPUCFG_CLUSTER0_RST_REG] /* Release power clamp */ mov r1, #0x00 mov r2, #0x4 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A80_RPRCM_CLUSTER0_PRW_CLAMP_REG str r1, [r6, r7] dsb mov r2, #0x40 - mul r7, r12, r2 + mul r7, r10, r2 add r7, r7, #AWIN_A80_RPRCM_CLUSTER0_PRW_CLAMP_STATUS_REG 1: ldr r1, [r5, r7] @@ -512,7 +523,7 @@ a80_mpinit_cpu: /* Clear power-off gating */ ldr r1, [r6, #AWIN_A80_RPRCM_CLUSTER0_PWR_GATING_REG] mov r0, #1 - lsl r0, r0, r12 + lsl r0, r0, r10 bic r1, r1, r0 str r1, [r6, #AWIN_A80_
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jakllsch Date: Wed Mar 8 17:06:35 UTC 2017 Modified Files: src/sys/arch/evbarm/awin: awin_sysconfig.c Log Message: Avoid tripping on opposite-endian sysconfig/fex blobs. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/awin/awin_sysconfig.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/awin/awin_sysconfig.c diff -u src/sys/arch/evbarm/awin/awin_sysconfig.c:1.2 src/sys/arch/evbarm/awin/awin_sysconfig.c:1.3 --- src/sys/arch/evbarm/awin/awin_sysconfig.c:1.2 Sun Oct 25 20:46:46 2015 +++ src/sys/arch/evbarm/awin/awin_sysconfig.c Wed Mar 8 17:06:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_sysconfig.c,v 1.2 2015/10/25 20:46:46 bouyer Exp $ */ +/* $NetBSD: awin_sysconfig.c,v 1.3 2017/03/08 17:06:35 jakllsch Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_allwinner.h" #include -__KERNEL_RCSID(0, "$NetBSD: awin_sysconfig.c,v 1.2 2015/10/25 20:46:46 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_sysconfig.c,v 1.3 2017/03/08 17:06:35 jakllsch Exp $"); #include #include @@ -90,6 +90,8 @@ static bool awin_sysconfig_parse(const c bool awin_sysconfig_init(void) { + struct awin_sysconfig_head head; + if (get_bootconf_option(boot_args, "sysconfig", BOOTOPT_TYPE_HEXINT, &awin_sysconfig_base) == 0) { return false; @@ -102,6 +104,13 @@ awin_sysconfig_init(void) (awin_sysconfig_base + KERNEL_BASE_VOFFSET); memcpy(awin_sysconfig, sysconfig, AWIN_SYSCONFIG_SIZE); + memcpy(&head, &awin_sysconfig[0], sizeof(head)); + if (head.count >= 0x0100) { + printf("%s(): 0x%x entries in sysconfig, ignoring.\n", + __func__, head.count); + return false; + } + return true; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: bouyer Date: Sun Oct 25 21:21:52 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Add calls to awin_hdmi_sysconfig() and awin_tcon_sysconfig(), missing from previous commit. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.44 src/sys/arch/evbarm/awin/awin_machdep.c:1.45 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.44 Sun Oct 25 20:54:19 2015 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Oct 25 21:21:52 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.44 2015/10/25 20:54:19 bouyer Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.45 2015/10/25 21:21:52 bouyer Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.44 2015/10/25 20:54:19 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.45 2015/10/25 21:21:52 bouyer Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -859,7 +859,19 @@ awin_device_register(device_t self, void "display-mode", "dvi"); } } +#ifdef AWIN_SYSCONFIG + if (awin_sysconfig_p) { + awin_hdmi_sysconfig(dict); + } +#endif } +#ifdef AWIN_SYSCONFIG + if (device_is_a(self, "awintcon")) { + if (awin_sysconfig_p) { + awin_tcon_sysconfig(self, dict); + } + } +#endif #if NAXP20X > 0 if (device_is_a(self, "axp20x")) {
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: bouyer Date: Sun Oct 25 20:46:46 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_sysconfig.c Log Message: Return an error instead of KASSERT() we don't get the expected type for a key. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/awin/awin_sysconfig.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/awin/awin_sysconfig.c diff -u src/sys/arch/evbarm/awin/awin_sysconfig.c:1.1 src/sys/arch/evbarm/awin/awin_sysconfig.c:1.2 --- src/sys/arch/evbarm/awin/awin_sysconfig.c:1.1 Wed Oct 22 00:24:52 2014 +++ src/sys/arch/evbarm/awin/awin_sysconfig.c Sun Oct 25 20:46:46 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_sysconfig.c,v 1.1 2014/10/22 00:24:52 jmcneill Exp $ */ +/* $NetBSD: awin_sysconfig.c,v 1.2 2015/10/25 20:46:46 bouyer Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_allwinner.h" #include -__KERNEL_RCSID(0, "$NetBSD: awin_sysconfig.c,v 1.1 2014/10/22 00:24:52 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_sysconfig.c,v 1.2 2015/10/25 20:46:46 bouyer Exp $"); #include #include @@ -154,7 +154,8 @@ awin_sysconfig_get_int(const char *key, if (awin_sysconfig_parse(key, subkey, &value) == false) return -1; - KASSERT(value.type == AWIN_SYSCONFIG_TYPE_SINGLE_WORD); + if (value.type != AWIN_SYSCONFIG_TYPE_SINGLE_WORD) + return -1; memcpy(&ret, &awin_sysconfig[value.offset << 2], sizeof(ret)); @@ -169,7 +170,8 @@ awin_sysconfig_get_string(const char *ke if (awin_sysconfig_parse(key, subkey, &value) == false) return NULL; - KASSERT(value.type == AWIN_SYSCONFIG_TYPE_STRING); + if (value.type != AWIN_SYSCONFIG_TYPE_STRING) + return NULL; return &awin_sysconfig[value.offset << 2]; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Wed Oct 21 09:25:16 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: axp20x is optional for allwinner boards To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.42 src/sys/arch/evbarm/awin/awin_machdep.c:1.43 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.42 Sat Oct 17 15:30:14 2015 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Oct 21 09:25:16 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.42 2015/10/17 15:30:14 bouyer Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.43 2015/10/21 09:25:16 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.42 2015/10/17 15:30:14 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.43 2015/10/21 09:25:16 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -140,6 +140,7 @@ __KERNEL_RCSID(0, "$NetBSD: awin_machdep #include "ukbd.h" #include "genfb.h" #include "ether.h" +#include "axp20x.h" #include #include @@ -178,7 +179,9 @@ __KERNEL_RCSID(0, "$NetBSD: awin_machdep #include #include +#if NAXP20X > 0 #include +#endif #include #include @@ -209,8 +212,11 @@ bool cubietruck_p; #define cubietruck_p false #endif +#if NAXP20X > 0 static device_t pmic_dev = NULL; static int pmic_cpu_dcdc; +#endif + #ifdef AWIN_SYSCONFIG bool awin_sysconfig_p; #else @@ -845,13 +851,15 @@ awin_device_register(device_t self, void } } } + +#if NAXP20X > 0 if (device_is_a(self, "axp20x")) { pmic_dev = self; #if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck || AWIN_board == AWIN_bpi || AWIN_board == AWIN_olimexlime2 pmic_cpu_dcdc = AXP20X_DCDC2; #endif } - +#endif #if NGENFB > 0 if (device_is_a(self, "genfb")) { @@ -875,10 +883,12 @@ awin_device_register(device_t self, void int awin_set_mpu_volt(int mvolt, bool poll) { - if (pmic_dev == NULL) { - return ENODEV; +#if NAXP20X > 0 + if (pmic_dev && device_is_a(pmic_dev, "axp20x")) { + return axp20x_set_dcdc(pmic_dev, pmic_cpu_dcdc, mvolt, 0); } - return axp20x_set_dcdc(pmic_dev, pmic_cpu_dcdc, mvolt, 0); +#endif + return ENODEV; } #ifdef AWIN_SYSCONFIG
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Wed Jun 3 10:01:32 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c platform.h Log Message: Olimex A20-OLinuXino-LIME2 support, from Greg Willatt To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/evbarm/awin/awin_machdep.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/awin/platform.h 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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.40 src/sys/arch/evbarm/awin/awin_machdep.c:1.41 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.40 Mon Apr 20 01:33:22 2015 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Jun 3 10:01:32 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.40 2015/04/20 01:33:22 matt Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.41 2015/06/03 10:01:32 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.40 2015/04/20 01:33:22 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.41 2015/06/03 10:01:32 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -660,7 +660,7 @@ awin_device_register(device_t self, void } else { prop_dictionary_set_bool(dict, "no-awge", true); } -#elif AWIN_board == AWIN_bpi +#elif AWIN_board == AWIN_bpi || AWIN_board == AWIN_olimexlime2 prop_dictionary_set_bool(dict, "no-awe", true); #endif return; @@ -725,7 +725,7 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "emacpwren", ">PH19"); } #endif -#if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck +#if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck || AWIN_board == AWIN_olimexlime2 prop_dictionary_set_cstring(dict, "mmc0detect", "
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: skrll Date: Sat Apr 18 11:04:49 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: Use character constants instead of ascii values for readability Print A80 in the A80 case and actually print the CPU number for A31/A80 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.11 src/sys/arch/evbarm/awin/awin_start.S:1.12 --- src/sys/arch/evbarm/awin/awin_start.S:1.11 Fri Dec 26 21:45:17 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Sat Apr 18 11:04:49 2015 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.11 2014/12/26 21:45:17 martin Exp $") +RCSID("$NetBSD: awin_start.S,v 1.12 2015/04/18 11:04:49 skrll Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -117,7 +117,7 @@ _C_LABEL(awin_start): movw r1, #:lower16:.Lmmu_init_table movt r1, #:upper16:.Lmmu_init_table bl arm_boot_l1pt_init - XPUTC(#68) + XPUTC(#'D') /* * Turn on the MMU, Caches, etc. Return to new enabled address space. @@ -141,13 +141,13 @@ _C_LABEL(awin_start): .pushsection .text,"ax",%progbits 1: #endif - XPUTC2(#90) + XPUTC2(#'Z') #if defined(MULTIPROCESSOR) // Now spin up the second processors into the same state we are now. - XPUTC2(#77) - XPUTC2(#80) - XPUTC2(#60) + XPUTC2(#'M') + XPUTC2(#'P') + XPUTC2(#'<') // Make sure the cache is flushed out to RAM for the other CPUs bl _C_LABEL(armv7_dcache_wbinv_all) @@ -193,7 +193,7 @@ _C_LABEL(awin_start): bl a80_mpinit #endif - XPUTC2(#62) + XPUTC2(#'>') #endif /* MULTIPROCESSOR */ XPUTC2(#13) XPUTC2(#10) @@ -220,9 +220,9 @@ a20_mpinit: movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET) movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET) - XPUTC2(#65) - XPUTC2(#50) - XPUTC2(#48) + XPUTC2(#'A') + XPUTC2(#'2') + XPUTC2(#'0') #ifdef __ARMEB__ setend le // everything here is little-endian @@ -315,9 +315,9 @@ a31_mpinit: movw r6, #:lower16:(AWIN_CORE_PBASE+AWIN_A31_PRCM_OFFSET) movt r6, #:upper16:(AWIN_CORE_PBASE+AWIN_A31_PRCM_OFFSET) - XPUTC2(#65) - XPUTC2(#51) - XPUTC2(#49) + XPUTC2(#'A') + XPUTC2(#'3') + XPUTC2(#'1') #ifdef __ARMEB__ setend le // everything here is little-endian @@ -327,7 +327,8 @@ a31_mpinit: a31_mpinit_cpu: - XPUTC2(r12) + add r1, r12, #'0' + XPUTC2(r1) /* Set where the other CPU(s) are going to execute */ movw r1, #:lower16:cortex_mpstart @@ -453,9 +454,9 @@ a80_mpinit: movw r6, #:lower16:(AWIN_A80_RCPUS_PBASE+AWIN_A80_RPRCM_OFFSET) movt r6, #:upper16:(AWIN_A80_RCPUS_PBASE+AWIN_A80_RPRCM_OFFSET) - XPUTC2(#65) - XPUTC2(#51) - XPUTC2(#49) + XPUTC2(#'A') + XPUTC2(#'8') + XPUTC2(#'0') #ifdef __ARMEB__ setend le // everything here is little-endian @@ -465,7 +466,8 @@ a80_mpinit: a80_mpinit_cpu: - XPUTC2(r12) + add r1, r12, #'0' + XPUTC2(r1) /* Set where the other CPU(s) are going to execute */ movw r1, #:lower16:cortex_mpstart
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Tue Jan 6 00:52:26 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: use BOOTOPT_TYPE_MACADDR To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.38 src/sys/arch/evbarm/awin/awin_machdep.c:1.39 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.38 Sun Jan 4 15:59:32 2015 +++ src/sys/arch/evbarm/awin/awin_machdep.c Tue Jan 6 00:52:26 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.38 2015/01/04 15:59:32 martin Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.39 2015/01/06 00:52:26 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.38 2015/01/04 15:59:32 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.39 2015/01/06 00:52:26 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -783,28 +783,18 @@ awin_device_register(device_t self, void return; } - if (device_is_a(self, "awge")) { + if (device_is_a(self, "awge") && device_unit(self) == 0) { #if NETHER > 0 /* * Get the GMAC MAC address from cmdline. */ uint8_t enaddr[ETHER_ADDR_LEN]; - char argname[strlen("awge?.mac-address") + 1]; - char *mac_addr; - snprintf(argname, sizeof(argname), "%s.mac-address", - device_xname(self)); - - if (get_bootconf_option(boot_args, argname, - BOOTOPT_TYPE_STRING, &mac_addr)) { - char mac[strlen("XX:XX:XX:XX:XX:XX") + 1]; - strlcpy(mac, mac_addr, sizeof(mac)); - if (!ether_aton_r(enaddr, sizeof(enaddr), mac)) { -prop_data_t pd; -pd = prop_data_create_data(enaddr, sizeof(enaddr)); -KASSERT(pd != NULL); -prop_dictionary_set(dict, "mac-address", pd); -prop_object_release(pd); - } + 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); } #endif
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: martin Date: Sun Jan 4 15:59:32 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Fix typo in BPI specific setup, spotted by Jared. Now awge works with the official sunxi-linux u-boot versions as well. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.37 src/sys/arch/evbarm/awin/awin_machdep.c:1.38 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.37 Fri Jan 2 11:46:53 2015 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Jan 4 15:59:32 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.37 2015/01/02 11:46:53 martin Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.38 2015/01/04 15:59:32 martin Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.37 2015/01/02 11:46:53 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.38 2015/01/04 15:59:32 martin Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -814,7 +814,7 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "phy-type", "mii"); } #endif -#if AWIN_BOARD == AWIN_bpi +#if AWIN_board == AWIN_bpi prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren"); prop_dictionary_set_cstring(dict, "phy-type", "rgmii-bpi"); prop_dictionary_set_uint8(dict, "pinset-func", 3);
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: martin Date: Fri Jan 2 11:46:53 UTC 2015 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Use pinset-func 3 for gmac on BananaPI (value taken from the only working u-boot driver). This makes root on NFS and ftp transfers work for me. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.36 src/sys/arch/evbarm/awin/awin_machdep.c:1.37 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.36 Thu Dec 11 23:35:11 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Fri Jan 2 11:46:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.36 2014/12/11 23:35:11 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.37 2015/01/02 11:46:53 martin Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.36 2014/12/11 23:35:11 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.37 2015/01/02 11:46:53 martin Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -817,7 +817,7 @@ awin_device_register(device_t self, void #if AWIN_BOARD == AWIN_bpi prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren"); prop_dictionary_set_cstring(dict, "phy-type", "rgmii-bpi"); - prop_dictionary_set_uint8(dict, "pinset-func", 5); + prop_dictionary_set_uint8(dict, "pinset-func", 3); #endif return; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: martin Date: Fri Dec 26 21:45:17 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: "Jared broke my kernel by adding comments!" - make it compile again To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.10 src/sys/arch/evbarm/awin/awin_start.S:1.11 --- src/sys/arch/evbarm/awin/awin_start.S:1.10 Mon Dec 22 23:46:50 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Fri Dec 26 21:45:17 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.10 2014/12/22 23:46:50 jmcneill Exp $") +RCSID("$NetBSD: awin_start.S,v 1.11 2014/12/26 21:45:17 martin Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -157,7 +157,8 @@ _C_LABEL(awin_start): movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET) ldr r1, [r5, #AWIN_SRAM_VER_REG] #ifdef __ARMEB__ - orr r1, r1, #(AWIN_SRAM_VER_R_EN << 8) # it's bit 15 + # it's bit 15 + orr r1, r1, #(AWIN_SRAM_VER_R_EN << 8) #else orr r1, r1, #AWIN_SRAM_VER_R_EN #endif
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Mon Dec 22 23:46:50 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: fix A20/A31 MP To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.9 src/sys/arch/evbarm/awin/awin_start.S:1.10 --- src/sys/arch/evbarm/awin/awin_start.S:1.9 Mon Dec 22 00:07:24 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Mon Dec 22 23:46:50 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.9 2014/12/22 00:07:24 jmcneill Exp $") +RCSID("$NetBSD: awin_start.S,v 1.10 2014/12/22 23:46:50 jmcneill Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -151,7 +151,7 @@ _C_LABEL(awin_start): // Make sure the cache is flushed out to RAM for the other CPUs bl _C_LABEL(armv7_dcache_wbinv_all) -#if defined(ALLWINNER_A20) + defined(ALLWINNER_A31) > 1 +#if defined(ALLWINNER_A20) || defined(ALLWINNER_A31) // Read SoC ID movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET) movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET)
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Wed Dec 10 17:45:53 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Use correct pinset function (5 not 2) for gmac on BananaPi To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.34 src/sys/arch/evbarm/awin/awin_machdep.c:1.35 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.34 Sun Dec 7 00:36:26 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Dec 10 17:45:53 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.34 2014/12/07 00:36:26 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.35 2014/12/10 17:45:53 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.34 2014/12/07 00:36:26 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.35 2014/12/10 17:45:53 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -807,7 +807,7 @@ awin_device_register(device_t self, void #if AWIN_BOARD == AWIN_bpi prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren"); prop_dictionary_set_cstring(dict, "phy-type", "rgmii-bpi"); - prop_dictionary_set_uint8(dict, "pinset-func", 2); + prop_dictionary_set_uint8(dict, "pinset-func", 5); #endif return; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Fri Dec 5 14:46:04 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: add A80 led and mmc0detect gpios To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.31 src/sys/arch/evbarm/awin/awin_machdep.c:1.32 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.31 Fri Dec 5 01:20:48 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Fri Dec 5 14:46:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.31 2014/12/05 01:20:48 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.32 2014/12/05 14:46:04 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.31 2014/12/05 01:20:48 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.32 2014/12/05 14:46:04 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -668,6 +668,10 @@ awin_device_register(device_t self, void #if AWIN_board == AWIN_cubietruck prop_dictionary_set_cstring(dict, "usb0restrict", ">PH0"); #endif +#if AWIN_board == AWIN_allwinner_a80 + prop_dictionary_set_cstring(dict, "status-led1", ">PH06"); + prop_dictionary_set_cstring(dict, "status-led2", ">PH17"); +#else prop_dictionary_set_cstring(dict, "status-led1", ">PH21"); prop_dictionary_set_cstring(dict, "status-led2", ">PH20"); if (cubietruck_p) { @@ -677,12 +681,15 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "hdd5ven", ">PH17"); prop_dictionary_set_cstring(dict, "emacpwren", ">PH19"); } +#endif #if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck prop_dictionary_set_cstring(dict, "mmc0detect", "
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Fri Dec 5 14:45:45 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: platform.h Log Message: add hummingbird A31 and allwinner A80 board types To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/awin/platform.h 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/awin/platform.h diff -u src/sys/arch/evbarm/awin/platform.h:1.1 src/sys/arch/evbarm/awin/platform.h:1.2 --- src/sys/arch/evbarm/awin/platform.h:1.1 Sun Aug 31 19:13:01 2014 +++ src/sys/arch/evbarm/awin/platform.h Fri Dec 5 14:45:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: platform.h,v 1.1 2014/08/31 19:13:01 matt Exp $ */ +/* $NetBSD: platform.h,v 1.2 2014/12/05 14:45:45 jmcneill Exp $ */ /* * Copyright (c) 2007 Microsoft * All rights reserved. @@ -34,6 +34,8 @@ #define AWIN_cubieboard 1 #define AWIN_cubietruck 2 #define AWIN_bpi 3 +#define AWIN_hummingbird_a31 4 +#define AWIN_allwinner_a80 5 #include
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Fri Dec 5 01:20:48 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: print when fixing up cbar value To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.30 src/sys/arch/evbarm/awin/awin_machdep.c:1.31 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.30 Fri Dec 5 01:13:11 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Fri Dec 5 01:20:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.30 2014/12/05 01:13:11 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.31 2014/12/05 01:20:48 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.30 2014/12/05 01:13:11 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.31 2014/12/05 01:20:48 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -582,12 +582,13 @@ awin_device_register(device_t self, void #if defined(ALLWINNER_A80) /* XXX Cubie4 SDK u-boot wrongly sets cbar to 0x01c8 */ if (armreg_cbar_read() != AWIN_A80_GIC_BASE) { + aprint_normal("fixup: cbar %#x -> %#x\n", + armreg_cbar_read(), AWIN_A80_GIC_BASE); prop_dictionary_set_uint32(dict, "cbar", AWIN_A80_GIC_BASE); } #endif - /* * XXX KLUDGE ALERT XXX * The iot mainbus supplies is completely wrong since it scales
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Mon Nov 17 00:50:40 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Allow for overriding DVI/HDMI detection with a kernel boot arg. Set hdmi.forcemode=dvi or hdmi.forcemode=hdmi to disable auto-detection. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.28 src/sys/arch/evbarm/awin/awin_machdep.c:1.29 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.28 Fri Nov 14 19:47:36 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Mon Nov 17 00:50:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.28 2014/11/14 19:47:36 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.29 2014/11/17 00:50:40 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.28 2014/11/14 19:47:36 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.29 2014/11/17 00:50:40 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -769,6 +769,20 @@ awin_device_register(device_t self, void } } + if (device_is_a(self, "awinhdmi")) { + char *display_mode; + if (get_bootconf_option(boot_args, "hdmi.forcemode", + BOOTOPT_TYPE_STRING, &display_mode)) { + if (strcasecmp(display_mode, "hdmi") == 0) { +prop_dictionary_set_cstring(dict, +"display-mode", "hdmi"); + } else if (strcasecmp(display_mode, "dvi") == 0) { +prop_dictionary_set_cstring(dict, +"display-mode", "dvi"); + } + } + } + #if NGENFB > 0 if (device_is_a(self, "genfb")) { #ifdef DDB
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Mon Nov 10 20:36:12 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: get_bootconf_option doesnt return the value null-terminated, so look for an awge0.mac-address value of exactly the correct length To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.26 src/sys/arch/evbarm/awin/awin_machdep.c:1.27 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.26 Mon Nov 10 17:56:08 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Mon Nov 10 20:36:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.26 2014/11/10 17:56:08 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.27 2014/11/10 20:36:12 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.26 2014/11/10 17:56:08 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.27 2014/11/10 20:36:12 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -725,14 +725,18 @@ awin_device_register(device_t self, void char *mac_addr; snprintf(argname, sizeof(argname), "%s.mac-address", device_xname(self)); + if (get_bootconf_option(boot_args, argname, - BOOTOPT_TYPE_STRING, &mac_addr) && - ether_aton_r(enaddr, sizeof(enaddr), mac_addr) == 0) { - prop_data_t pd; - pd = prop_data_create_data(enaddr, sizeof(enaddr)); - KASSERT(pd != NULL); - prop_dictionary_set(dict, "mac-address", pd); - prop_object_release(pd); + BOOTOPT_TYPE_STRING, &mac_addr)) { + char mac[strlen("XX:XX:XX:XX:XX:XX") + 1]; + strlcpy(mac, mac_addr, sizeof(mac)); + if (!ether_aton_r(enaddr, sizeof(enaddr), mac)) { +prop_data_t pd; +pd = prop_data_create_data(enaddr, sizeof(enaddr)); +KASSERT(pd != NULL); +prop_dictionary_set(dict, "mac-address", pd); +prop_object_release(pd); + } } #if AWIN_board == AWIN_cubieboard
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Mon Nov 10 17:56:08 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: If boot args contains "console=fb", use genfb for console device. Also set db_trap_callback so we can use VCONS_DRAW_INTR To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.25 src/sys/arch/evbarm/awin/awin_machdep.c:1.26 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.25 Fri Nov 7 11:42:28 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Mon Nov 10 17:56:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.25 2014/11/07 11:42:28 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.26 2014/11/10 17:56:08 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.25 2014/11/07 11:42:28 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.26 2014/11/10 17:56:08 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -138,6 +138,7 @@ __KERNEL_RCSID(0, "$NetBSD: awin_machdep #include "com.h" #include "ukbd.h" +#include "genfb.h" #include #include @@ -755,6 +756,24 @@ awin_device_register(device_t self, void #endif return; } + +#if NGENFB > 0 + if (device_is_a(self, "genfb")) { +#ifdef DDB + db_trap_callback = awin_fb_ddb_trap_callback; +#endif + char *ptr; + if (get_bootconf_option(boot_args, "console", + BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) { + prop_dictionary_set_bool(dict, "is_console", true); +#if NUKBD > 0 + ukbd_cnattach(); +#endif + } else { + prop_dictionary_set_bool(dict, "is_console", false); + } + } +#endif } #ifdef AWIN_SYSCONFIG
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: matt Date: Wed Nov 5 17:46:51 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: Only look at the ID register if we are configured for multiple SoCs. Make sure that the ID register is dealt with correctly for BE as well. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.5 src/sys/arch/evbarm/awin/awin_start.S:1.6 --- src/sys/arch/evbarm/awin/awin_start.S:1.5 Thu Oct 30 01:15:30 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Wed Nov 5 17:46:51 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.5 2014/10/30 01:15:30 jmcneill Exp $") +RCSID("$NetBSD: awin_start.S,v 1.6 2014/11/05 17:46:51 matt Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -151,26 +151,43 @@ _C_LABEL(awin_start): // Make sure the cache is flushed out to RAM for the other CPUs bl _C_LABEL(armv7_dcache_wbinv_all) +#if defined(ALLWINNER_A20) + defined(ALLWINNER_A31) + defined(ALLWINNER_A80) > 1 // Read SoC ID movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET) movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET) ldr r1, [r5, #AWIN_SRAM_VER_REG] - orr r1, r1, AWIN_SRAM_VER_R_EN +#ifdef __ARMEB__ + orr r1, r1, #(AWIN_SRAM_VER_R_EN << 8) # it's bit 15 +#else + orr r1, r1, #AWIN_SRAM_VER_R_EN +#endif str r1, [r5, #AWIN_SRAM_VER_REG] dsb ldr r1, [r5, #AWIN_SRAM_VER_REG] +#ifdef __ARMEB__ + rev r1, r1 +#endif lsr r1, r1, #16 +#endif /* ALLWINNER_A20 + ALLWINNER_A31 + ALLWINNER_A80 > 1 */ // MP init based on SoC ID #if defined(ALLWINNER_A20) +# if defined(ALLWINNER_A31) || defined(ALLWINNER_A80) movw r0, #AWIN_SRAM_VER_KEY_A20 cmp r1, r0 bleq a20_mpinit +# else + bl a20_mpinit +# endif #endif #if defined(ALLWINNER_A31) +# if defined(ALLWINNER_A20) || defined(ALLWINNER_A80) movw r0, #AWIN_SRAM_VER_KEY_A31 cmp r1, r0 bleq a31_mpinit +# else + bl a31_mpinit +# endif #endif XPUTC2(#62)
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Thu Oct 30 01:15:30 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: fix a31_mpinit sync for real this time (thanks matt@) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.4 src/sys/arch/evbarm/awin/awin_start.S:1.5 --- src/sys/arch/evbarm/awin/awin_start.S:1.4 Thu Oct 30 00:55:53 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Thu Oct 30 01:15:30 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.4 2014/10/30 00:55:53 jmcneill Exp $") +RCSID("$NetBSD: awin_start.S,v 1.5 2014/10/30 01:15:30 jmcneill Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -409,8 +409,8 @@ a31_mpinit_cpu: 1: dmb // memory barrier ldr r0, [r6] // load hatched - tst r0, #0xe // our bits set yet? - bxeq r4// yes, return + cmp r0, #0xe // our bits set yet? + bxge r4// yes, return subs r5, r5, #1 // decrement count bxeq r4// 0? return mov r0, #0x1d800 // 5.03ms
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Thu Oct 30 00:55:53 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: fix a31_mpinit synchronization To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.3 src/sys/arch/evbarm/awin/awin_start.S:1.4 --- src/sys/arch/evbarm/awin/awin_start.S:1.3 Fri Oct 10 23:51:28 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Thu Oct 30 00:55:53 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.3 2014/10/10 23:51:28 jmcneill Exp $") +RCSID("$NetBSD: awin_start.S,v 1.4 2014/10/30 00:55:53 jmcneill Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -410,7 +410,7 @@ a31_mpinit_cpu: 1: dmb // memory barrier ldr r0, [r6] // load hatched tst r0, #0xe // our bits set yet? - bxne r4// yes, return + bxeq r4// yes, return subs r5, r5, #1 // decrement count bxeq r4// 0? return mov r0, #0x1d800 // 5.03ms
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Thu Oct 30 00:32:55 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: pass usb_restrict_gpio from fex to gpio driver To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.22 src/sys/arch/evbarm/awin/awin_machdep.c:1.23 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.22 Wed Oct 29 10:28:03 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Thu Oct 30 00:32:55 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.22 2014/10/29 10:28:03 joerg Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.23 2014/10/30 00:32:55 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.22 2014/10/29 10:28:03 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.23 2014/10/30 00:32:55 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -768,12 +768,15 @@ awin_gpio_sysconfig(prop_dictionary_t di { "usb0drv", "usbc0", "usb_drv_vbus_gpio" }, { "usb0iddet", "usbc0", "usb_id_gpio" }, { "usb0vbusdet", "usbc0", "usb_det_vbus_gpio" }, + { "usb0restrict", "usbc0", "usb_restrict_gpio" }, { "usb1drv", "usbc1", "usb_drv_vbus_gpio" }, { "usb1iddet", "usbc1", "usb_id_gpio" }, { "usb1vbusdet", "usbc1", "usb_det_vbus_gpio" }, + { "usb1restrict", "usbc1", "usb_restrict_gpio" }, { "usb2drv", "usbc2", "usb_drv_vbus_gpio" }, { "usb2iddet", "usbc2", "usb_id_gpio" }, { "usb2vbusdet", "usbc2", "usb_det_vbus_gpio" }, + { "usb2restrict", "usbc2", "usb_restrict_gpio" }, { "status-led1", "leds_para", "leds_pin_1" }, { "status-led2", "leds_para", "leds_pin_2" }, { "status-led3", "leds_para", "leds_pin_3" },
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: joerg Date: Wed Oct 29 10:28:03 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Don't hang when booting Cubietruck via FEL. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.21 src/sys/arch/evbarm/awin/awin_machdep.c:1.22 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.21 Wed Oct 22 11:11:40 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Oct 29 10:28:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.21 2014/10/22 11:11:40 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.22 2014/10/29 10:28:03 joerg Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.21 2014/10/22 11:11:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.22 2014/10/29 10:28:03 joerg Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -647,6 +647,9 @@ awin_device_register(device_t self, void (cubietruck_p ? "PH6"); #endif +#if AWIN_board == AWIN_cubietruck + prop_dictionary_set_cstring(dict, "usb0restrict", ">PH0"); +#endif prop_dictionary_set_cstring(dict, "status-led1", ">PH21"); prop_dictionary_set_cstring(dict, "status-led2", ">PH20"); if (cubietruck_p) {
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Wed Oct 22 11:11:40 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: map gmac_phy_power.gmac_phy_power_en to gmacpwren To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.20 src/sys/arch/evbarm/awin/awin_machdep.c:1.21 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.20 Wed Oct 22 00:24:52 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Oct 22 11:11:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.20 2014/10/22 00:24:52 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.21 2014/10/22 11:11:40 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.20 2014/10/22 00:24:52 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.21 2014/10/22 11:11:40 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -777,6 +777,7 @@ awin_gpio_sysconfig(prop_dictionary_t di { "status-led4", "leds_para", "leds_pin_4" }, { "mmc0detect", "mmc0_para", "sdc_det" }, { "audiopactrl", "audio_para", "audio_pa_ctrl" }, + { "gmacpwren", "gmac_phy_power", "gmac_phy_power_en" }, }; unsigned int n;
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sun Oct 19 22:37:08 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: add some hummingbird A31 motg pins To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.18 src/sys/arch/evbarm/awin/awin_machdep.c:1.19 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.18 Sun Oct 19 22:34:55 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Oct 19 22:37:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.18 2014/10/19 22:34:55 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.19 2014/10/19 22:37:08 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.18 2014/10/19 22:34:55 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.19 2014/10/19 22:37:08 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -601,6 +601,10 @@ awin_device_register(device_t self, void } #endif #if AWIN_board == AWIN_hummingbird_a31 + prop_dictionary_set_cstring(dict, "usb0iddet", "PA17"); + prop_dictionary_set_cstring(dict, "usb0restrict", ">PA18"); prop_dictionary_set_cstring(dict, "usb1drv", ">PH27"); prop_dictionary_set_cstring(dict, "usb1restrict", ">PH26"); prop_dictionary_set_cstring(dict, "usb2drv", ">PH24");
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sun Oct 19 22:34:55 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: allow awge mac address to be overriden by uEnv bootargs; set awge0.mac-address=XX:XX:XX:XX:XX:XX To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.17 src/sys/arch/evbarm/awin/awin_machdep.c:1.18 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.17 Sat Oct 18 12:36:39 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Oct 19 22:34:55 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.17 2014/10/18 12:36:39 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.18 2014/10/19 22:34:55 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.17 2014/10/18 12:36:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.18 2014/10/19 22:34:55 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -678,6 +678,24 @@ awin_device_register(device_t self, void } if (device_is_a(self, "awge")) { + /* + * Get the GMAC MAC address from cmdline. + */ + uint8_t enaddr[ETHER_ADDR_LEN]; + char argname[strlen("awge?.mac-address") + 1]; + char *mac_addr; + snprintf(argname, sizeof(argname), "%s.mac-address", + device_xname(self)); + if (get_bootconf_option(boot_args, argname, + BOOTOPT_TYPE_STRING, &mac_addr) && + ether_aton_r(enaddr, sizeof(enaddr), mac_addr) == 0) { + prop_data_t pd; + pd = prop_data_create_data(enaddr, sizeof(enaddr)); + KASSERT(pd != NULL); + prop_dictionary_set(dict, "mac-address", pd); + prop_object_release(pd); + } + #if AWIN_board == AWIN_cubieboard if (awin_chip_id() == AWIN_CHIP_ID_A20) { /* Cubieboard2 uses GMAC with a 100Mbit PHY */
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sat Oct 18 12:36:39 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: setup gmac phy power gpio for Bananapi To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.16 src/sys/arch/evbarm/awin/awin_machdep.c:1.17 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.16 Fri Oct 17 20:24:18 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sat Oct 18 12:36:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.16 2014/10/17 20:24:18 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.17 2014/10/18 12:36:39 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.16 2014/10/17 20:24:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.17 2014/10/18 12:36:39 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -635,6 +635,10 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "audiopactrl", ">PH15"); #endif +#if AWIN_board == AWIN_bpi + prop_dictionary_set_cstring(dict, "gmacpwren", ">PH23"); +#endif + /* * These pins have no connections. */ @@ -680,6 +684,9 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "phy-type", "mii"); } #endif +#if AWIN_BOARD == AWIN_bpi + prop_dictionary_set_cstring(dict, "phy-power", "gmacpwren"); +#endif return; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Fri Oct 17 20:24:18 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Cubieboard2 uses GMAC with a 100Mbit PHY. Set phy-type property to "mii" for awge To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.15 src/sys/arch/evbarm/awin/awin_machdep.c:1.16 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.15 Sun Oct 12 14:04:52 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Fri Oct 17 20:24:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.15 2014/10/12 14:04:52 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.16 2014/10/17 20:24:18 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.15 2014/10/12 14:04:52 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.16 2014/10/17 20:24:18 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -673,6 +673,16 @@ awin_device_register(device_t self, void return; } + if (device_is_a(self, "awge")) { +#if AWIN_board == AWIN_cubieboard + if (awin_chip_id() == AWIN_CHIP_ID_A20) { + /* Cubieboard2 uses GMAC with a 100Mbit PHY */ + prop_dictionary_set_cstring(dict, "phy-type", "mii"); + } +#endif + return; + } + if (device_is_a(self, "com")) { #if NAWIN_FB > 0 if (use_fb_console)
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sun Oct 12 14:04:52 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: PH22 for audiopactrl on Hummingbird A31 To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.14 src/sys/arch/evbarm/awin/awin_machdep.c:1.15 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.14 Sun Oct 12 13:08:12 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Oct 12 14:04:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.14 2014/10/12 13:08:12 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.15 2014/10/12 14:04:52 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.14 2014/10/12 13:08:12 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.15 2014/10/12 14:04:52 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -628,7 +628,12 @@ awin_device_register(device_t self, void #elif AWIN_board == AWIN_hummingbird_a31 prop_dictionary_set_cstring(dict, "mmc0detect", "PH22"); +#else prop_dictionary_set_cstring(dict, "audiopactrl", ">PH15"); +#endif /* * These pins have no connections.
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sun Oct 12 13:08:12 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: define usb1restrict pin for Hummingbird A31 To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.13 src/sys/arch/evbarm/awin/awin_machdep.c:1.14 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.13 Fri Oct 10 07:37:50 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Oct 12 13:08:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.13 2014/10/10 07:37:50 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.14 2014/10/12 13:08:12 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.13 2014/10/10 07:37:50 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.14 2014/10/12 13:08:12 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -602,6 +602,7 @@ awin_device_register(device_t self, void #endif #if AWIN_board == AWIN_hummingbird_a31 prop_dictionary_set_cstring(dict, "usb1drv", ">PH27"); + prop_dictionary_set_cstring(dict, "usb1restrict", ">PH26"); prop_dictionary_set_cstring(dict, "usb2drv", ">PH24"); #else prop_dictionary_set_cstring(dict, "usb2drv", ">PH3");
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Fri Oct 10 23:51:28 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: A31 SMP support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.2 src/sys/arch/evbarm/awin/awin_start.S:1.3 --- src/sys/arch/evbarm/awin/awin_start.S:1.2 Thu Sep 25 07:59:29 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Fri Oct 10 23:51:28 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.2 2014/09/25 07:59:29 matt Exp $") +RCSID("$NetBSD: awin_start.S,v 1.3 2014/10/10 23:51:28 jmcneill Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -150,7 +150,29 @@ _C_LABEL(awin_start): XPUTC2(#60) // Make sure the cache is flushed out to RAM for the other CPUs bl _C_LABEL(armv7_dcache_wbinv_all) - bl a20_mpinit + + // Read SoC ID + movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET) + movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_SRAM_OFFSET) + ldr r1, [r5, #AWIN_SRAM_VER_REG] + orr r1, r1, AWIN_SRAM_VER_R_EN + str r1, [r5, #AWIN_SRAM_VER_REG] + dsb + ldr r1, [r5, #AWIN_SRAM_VER_REG] + lsr r1, r1, #16 + + // MP init based on SoC ID +#if defined(ALLWINNER_A20) + movw r0, #AWIN_SRAM_VER_KEY_A20 + cmp r1, r0 + bleq a20_mpinit +#endif +#if defined(ALLWINNER_A31) + movw r0, #AWIN_SRAM_VER_KEY_A31 + cmp r1, r0 + bleq a31_mpinit +#endif + XPUTC2(#62) #endif /* MULTIPROCESSOR */ XPUTC2(#13) @@ -178,6 +200,10 @@ a20_mpinit: movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET) movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET) + XPUTC2(#65) + XPUTC2(#50) + XPUTC2(#48) + #ifdef __ARMEB__ setend le // everything here is little-endian #endif @@ -258,6 +284,144 @@ ASEND(a20_mpinit) #ifndef KERNEL_BASES_EQUAL .popsection #endif + +#ifndef KERNEL_BASES_EQUAL + .pushsection .text,"ax",%progbits +#endif +a31_mpinit: + mov r4, lr // because we call gtmr_bootdelay + movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_A31_CPUCFG_OFFSET) + movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_A31_CPUCFG_OFFSET) + movw r6, #:lower16:(AWIN_CORE_PBASE+AWIN_A31_PRCM_OFFSET) + movt r6, #:upper16:(AWIN_CORE_PBASE+AWIN_A31_PRCM_OFFSET) + + XPUTC2(#65) + XPUTC2(#51) + XPUTC2(#49) + +#ifdef __ARMEB__ + setend le // everything here is little-endian +#endif + + mov r12, #1 // CPU number + +a31_mpinit_cpu: + + XPUTC2(r12) + + /* Set where the other CPU(s) are going to execute */ + movw r1, #:lower16:cortex_mpstart + movt r1, #:upper16:cortex_mpstart + str r1, [r5, #AWIN_CPUCFG_PRIVATE_REG] + dsb + + /* Assert CPU core reset */ + mov r1, #0 + mov r2, #0x40 + mul r7, r12, r2 + add r7, r7, #AWIN_A31_CPUCFG_CPU0_RST_CTRL_REG + str r1, [r5, r7] + dsb + + /* Ensure CPUX reset also invalidates its L1 caches */ + ldr r1, [r5, #AWIN_CPUCFG_GENCTRL_REG] + mov r0, #1 + lsl r0, r0, r12 + bic r1, r1, r0 + str r1, [r5, #AWIN_CPUCFG_GENCTRL_REG] + dsb + + /* Release power clamp */ + mov r1, #0xe7 + mov r2, #0x4 + mul r7, r12, r2 + add r7, r7, #AWIN_A31_PRCM_CPUX_PWR_CLAMP_REG + str r1, [r6, r7] + dsb + + mov r2, #0x40 + mul r7, r12, r2 + add r7, r7, #AWIN_A31_CPUCFG_CPU0_PWR_CLAMP_STATUS_REG +1: + ldr r1, [r5, r7] + cmp r1, #0xe7 + bne 1b + + /* We need to wait (at least) 10ms */ + mov r0, #0x3b000 // 10.06ms + bl _C_LABEL(gtmr_bootdelay) // endian-neutral + + /* Restore power clamp */ + mov r1, #0 + mov r2, #0x4 + mul r7, r12, r2 + add r7, r7, #AWIN_A31_PRCM_CPUX_PWR_CLAMP_REG + str r1, [r6, r7] + dsb + + mov r2, #0x40 + mul r7, r12, r2 + add r7, r7, #AWIN_A31_CPUCFG_CPU0_PWR_CLAMP_STATUS_REG +1: + ldr r1, [r5, r7] + cmp r1, #0 + bne 1b + + /* We need to wait (at least) 10ms */ + mov r0, #0x3b000 // 10.06ms + bl _C_LABEL(gtmr_bootdelay) // endian-neutral + + /* Clear power-off gating */ + ldr r1, [r6, #AWIN_A31_PRCM_PWROFF_GATING_REG] + mov r0, #1 + lsl r0, r0, r12 + bic r1, r1, r0 + str r1, [r6, #AWIN_A31_PRCM_PWROFF_GATING_REG] + dsb + + /* We need to wait (at least) 10ms */ + mov r0, #0x3b000 // 10.06ms + bl _C_LABEL(gtmr_bootdelay) // endian-neutral + + /* Bring CPUX out of reset */ + mov r1, #(AWIN_A31_CPUCFG_RST_CTRL_CPU_RESET|AWIN_A31_CPUCFG_RST_CTRL_CORE_RESET) + mov r2, #0x40 + mul r7, r12, r2 + add r7, r7, #AWIN_A31_CPUCFG_CPU0_RST_CTRL_REG + str r1, [r5, r7] + dsb + + /* If there is another CPU, start it */ + add r12, r12, #1 + cmp r12, #3 + ble a31_mpinit_cpu + +#ifdef __ARMEB__ + setend be// we're done with little endian +#endif + + // + // Wait up a second for CPU1-3 to hatch. + // + movw r6, #:lower16:arm_cpu_hatched + movt r6, #:upper16:arm_cpu_hatched + mov r5, #200 // 200 x 5ms + +1: dmb // memory barrier + ldr r0, [r6] // load hatched + tst r0, #0xe // our bits set yet? + bxne r4// yes, return + subs r
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: matt Date: Thu Sep 25 07:59:29 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_start.S Log Message: When spinning up the 2nd CPU, do it in little-endian mode so we access the chip's registers properly. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/awin/awin_start.S 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/awin/awin_start.S diff -u src/sys/arch/evbarm/awin/awin_start.S:1.1 src/sys/arch/evbarm/awin/awin_start.S:1.2 --- src/sys/arch/evbarm/awin/awin_start.S:1.1 Sun Aug 31 19:13:01 2014 +++ src/sys/arch/evbarm/awin/awin_start.S Thu Sep 25 07:59:29 2014 @@ -41,7 +41,7 @@ #include #include -RCSID("$NetBSD: awin_start.S,v 1.1 2014/08/31 19:13:01 matt Exp $") +RCSID("$NetBSD: awin_start.S,v 1.2 2014/09/25 07:59:29 matt Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -178,6 +178,10 @@ a20_mpinit: movw r5, #:lower16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET) movt r5, #:upper16:(AWIN_CORE_PBASE+AWIN_CPUCFG_OFFSET) +#ifdef __ARMEB__ + setend le // everything here is little-endian +#endif + /* Set where the other CPU(s) are going to execute */ movw r1, #:lower16:cortex_mpstart movt r1, #:upper16:cortex_mpstart @@ -210,7 +214,7 @@ a20_mpinit: /* We need to wait (at least) 10ms */ mov r0, #0x3b000 // 10.06ms - bl _C_LABEL(gtmr_bootdelay) + bl _C_LABEL(gtmr_bootdelay) // endian-neutral /* Clear power-off gating */ ldr r1, [r5, #AWIN_CPUCFG_CPU1_PWROFF_REG] @@ -230,6 +234,10 @@ a20_mpinit: str r1, [r5, #AWIN_CPUCFG_DBGCTRL1_REG] dsb +#ifdef __ARMEB__ + setend be// we're done with little endian +#endif + // // Wait up a second for CPU1 to hatch. //
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: skrll Date: Tue Sep 23 15:02:08 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Fix up usb0drv for BPI To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.11 src/sys/arch/evbarm/awin/awin_machdep.c:1.12 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.11 Mon Sep 15 19:30:16 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Tue Sep 23 15:02:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.11 2014/09/15 19:30:16 martin Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.12 2014/09/23 15:02:08 skrll Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.11 2014/09/15 19:30:16 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.12 2014/09/23 15:02:08 skrll Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -591,7 +591,7 @@ awin_device_register(device_t self, void */ prop_dictionary_set_cstring(dict, "satapwren", (cubietruck_p ? ">PH12" : ">PB8")); -#if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck +#if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck || AWIN_board == AWIN_bpi if (cubietruck_p) { prop_dictionary_set_cstring(dict, "usb0drv", ">PH17"); } else if (awin_chip_id() == AWIN_CHIP_ID_A20) {
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: martin Date: Mon Sep 15 19:30:16 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: BOARDTYPE is now a string, use it directly. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.10 src/sys/arch/evbarm/awin/awin_machdep.c:1.11 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.10 Sat Sep 13 02:21:52 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Mon Sep 15 19:30:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.10 2014/09/13 02:21:52 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.11 2014/09/15 19:30:16 martin Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.10 2014/09/13 02:21:52 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.11 2014/09/15 19:30:16 martin Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -335,7 +335,7 @@ initarm(void *arg) #ifdef VERBOSE_INIT_ARM /* Talk to the user */ - printf("\nNetBSD/evbarm (" __STRING(BOARDTYPE) ") booting ...\n"); + printf("\nNetBSD/evbarm (" BOARDTYPE ") booting ...\n"); #endif #ifdef BOOT_ARGS
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sat Sep 13 02:21:52 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: AWIN_board not AWIN_BOARD To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.9 src/sys/arch/evbarm/awin/awin_machdep.c:1.10 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.9 Sat Sep 13 01:36:07 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sat Sep 13 02:21:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.9 2014/09/13 01:36:07 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.10 2014/09/13 02:21:52 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.9 2014/09/13 01:36:07 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.10 2014/09/13 02:21:52 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -591,7 +591,7 @@ awin_device_register(device_t self, void */ prop_dictionary_set_cstring(dict, "satapwren", (cubietruck_p ? ">PH12" : ">PB8")); -#if AWIN_BOARD == AWIN_cubieboard || AWIN_board == AWIN_cubietruck +#if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck if (cubietruck_p) { prop_dictionary_set_cstring(dict, "usb0drv", ">PH17"); } else if (awin_chip_id() == AWIN_CHIP_ID_A20) {
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Sat Sep 13 01:36:07 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: usb0drv is >PB9 for cubie2 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.8 src/sys/arch/evbarm/awin/awin_machdep.c:1.9 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.8 Wed Sep 10 07:39:17 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sat Sep 13 01:36:07 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.8 2014/09/10 07:39:17 skrll Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.9 2014/09/13 01:36:07 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.8 2014/09/10 07:39:17 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.9 2014/09/13 01:36:07 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -591,8 +591,15 @@ awin_device_register(device_t self, void */ prop_dictionary_set_cstring(dict, "satapwren", (cubietruck_p ? ">PH12" : ">PB8")); - prop_dictionary_set_cstring(dict, "usb0drv", - (cubietruck_p ? ">PH17" : ">PB2")); +#if AWIN_BOARD == AWIN_cubieboard || AWIN_board == AWIN_cubietruck + if (cubietruck_p) { + prop_dictionary_set_cstring(dict, "usb0drv", ">PH17"); + } else if (awin_chip_id() == AWIN_CHIP_ID_A20) { + prop_dictionary_set_cstring(dict, "usb0drv", ">PB9"); + } else { + prop_dictionary_set_cstring(dict, "usb0drv", ">PB2"); + } +#endif prop_dictionary_set_cstring(dict, "usb2drv", ">PH3"); prop_dictionary_set_cstring(dict, "usb0iddet", (cubietruck_p ? "
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: skrll Date: Wed Sep 10 07:39:17 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Don't grab the ubootinfo structure and try to determine the mac address from it. Rely on reading the mac from the chip. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.7 src/sys/arch/evbarm/awin/awin_machdep.c:1.8 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.7 Wed Sep 10 06:50:13 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Sep 10 07:39:17 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.7 2014/09/10 06:50:13 matt Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.8 2014/09/10 07:39:17 skrll Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.7 2014/09/10 06:50:13 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.8 2014/09/10 07:39:17 skrll Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -192,7 +192,6 @@ BootConfig bootconfig; /* Boot config s static char bootargs[MAX_BOOT_STRING]; char *boot_args = NULL; char *boot_file = NULL; -static uint8_t uboot_enaddr[ETHER_ADDR_LEN]; #if AWIN_board == AWIN_cubieboard bool cubietruck_p; @@ -339,8 +338,6 @@ initarm(void *arg) printf("\nNetBSD/evbarm (" __STRING(BOARDTYPE) ") booting ...\n"); #endif - const uint8_t *uboot_bootinfo = (void*)uboot_args[0]; - #ifdef BOOT_ARGS char mi_bootargs[] = BOOT_ARGS; parse_mi_bootargs(mi_bootargs); @@ -419,16 +416,8 @@ initarm(void *arg) (uboot_args[3] + KERNEL_BASE_VOFFSET); strlcpy(bootargs, args, sizeof(bootargs)); } - if (uboot_args[0] - && uboot_args[0] - AWIN_SDRAM_PBASE < ram_size) { - uboot_bootinfo = - (void*)(uboot_args[0] + KERNEL_BASE_VOFFSET); - } } - /* copy u-boot bootinfo ethernet address */ - memcpy(uboot_enaddr, uboot_bootinfo + 0x250, sizeof(uboot_enaddr)); - boot_args = bootargs; parse_mi_bootargs(boot_args); @@ -635,12 +624,6 @@ awin_device_register(device_t self, void prop_dictionary_set_uint32(dict, "nc-i", 0x003fc03f); return; } - if (device_is_a(self, "awge") || device_is_a(self, "awe")) { - prop_data_t blob = - prop_data_create_data(uboot_enaddr, ETHER_ADDR_LEN); - prop_dictionary_set(dict, "mac-address", blob); - prop_object_release(blob); - } if (device_is_a(self, "ehci")) { return;
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: matt Date: Wed Sep 10 06:50:13 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: Remove hack disabling dma for awinmmc0 on cubietruck. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.6 src/sys/arch/evbarm/awin/awin_machdep.c:1.7 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.6 Tue Sep 9 21:04:05 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Wed Sep 10 06:50:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.6 2014/09/09 21:04:05 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.7 2014/09/10 06:50:13 matt Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.6 2014/09/09 21:04:05 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.7 2014/09/10 06:50:13 matt Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -660,8 +660,6 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "led-gpio", "status-led2"); } - if (cubietruck_p) - prop_dictionary_set_bool(dict, "dma", false); return; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Tue Sep 9 21:04:05 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: disable dma on cubietruck for now To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.5 src/sys/arch/evbarm/awin/awin_machdep.c:1.6 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.5 Tue Sep 9 02:43:19 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Tue Sep 9 21:04:05 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.5 2014/09/09 02:43:19 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.6 2014/09/09 21:04:05 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.5 2014/09/09 02:43:19 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.6 2014/09/09 21:04:05 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -660,6 +660,8 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "led-gpio", "status-led2"); } + if (cubietruck_p) + prop_dictionary_set_bool(dict, "dma", false); return; }
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Tue Sep 9 02:43:19 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: cubieboard2 uses awge not awe To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.4 src/sys/arch/evbarm/awin/awin_machdep.c:1.5 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.4 Sun Sep 7 06:26:08 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Tue Sep 9 02:43:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.4 2014/09/07 06:26:08 skrll Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.5 2014/09/09 02:43:19 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.4 2014/09/07 06:26:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.5 2014/09/09 02:43:19 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -585,7 +585,7 @@ awin_device_register(device_t self, void if (device_is_a(self, "awinio")) { #if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck - if (cubietruck_p) { + if (awin_chip_id() == AWIN_CHIP_ID_A20) { prop_dictionary_set_bool(dict, "no-awe", true); } else { prop_dictionary_set_bool(dict, "no-awge", true);
CVS commit: src/sys/arch/evbarm/awin
Module Name:src Committed By: jmcneill Date: Thu Sep 4 02:34:30 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Log Message: audio gpio setup To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/awin/awin_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/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.1 src/sys/arch/evbarm/awin/awin_machdep.c:1.2 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.1 Sun Aug 31 19:13:01 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Thu Sep 4 02:34:30 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.1 2014/08/31 19:13:01 matt Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.2 2014/09/04 02:34:30 jmcneill Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.1 2014/08/31 19:13:01 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.2 2014/09/04 02:34:30 jmcneill Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -622,6 +622,7 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, "emacpwren", ">PH19"); } prop_dictionary_set_cstring(dict, "mmc0detect", "PH15"); /* * These pins have no connections. @@ -660,6 +661,11 @@ awin_device_register(device_t self, void return; } + if (device_is_a(self, "awinac")) { + prop_dictionary_set_cstring(dict, "pactrl-gpio", "audiopactrl"); + return; + } + if (device_is_a(self, "com")) { #if NAWIN_FB > 0 if (use_fb_console)