Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/amlogic don't rely on u-boot to setup CARD and ...



details:   https://anonhg.NetBSD.org/src/rev/5057080a5a4c
branches:  trunk
changeset: 339750:5057080a5a4c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Aug 08 10:51:40 2015 +0000

description:
don't rely on u-boot to setup CARD and BOOT pins

diffstat:

 sys/arch/arm/amlogic/amlogic_board.c |  26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diffs (68 lines):

diff -r 3e795218d9bc -r 5057080a5a4c sys/arch/arm/amlogic/amlogic_board.c
--- a/sys/arch/arm/amlogic/amlogic_board.c      Sat Aug 08 10:50:55 2015 +0000
+++ b/sys/arch/arm/amlogic/amlogic_board.c      Sat Aug 08 10:51:40 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_board.c,v 1.13 2015/08/04 01:23:07 jmcneill Exp $ */
+/* $NetBSD: amlogic_board.c,v 1.14 2015/08/08 10:51:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_amlogic.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amlogic_board.c,v 1.13 2015/08/04 01:23:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_board.c,v 1.14 2015/08/08 10:51:40 jmcneill Exp $");
 
 #define        _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -235,6 +235,11 @@
 {
        switch (port) {
        case AMLOGIC_SDHC_PORT_B:
+               /* Set CARD 0-5 to input */
+               CBUS_SET_CLEAR(PAD_PULL_UP_2_REG, 0x03f00000, 0);
+               CBUS_SET_CLEAR(PAD_PULL_UP_EN_2_REG, 0x03f00000, 0);
+               CBUS_SET_CLEAR(PREG_PAD_GPIO0_EN_N_REG, 0x0fc00000, 0);
+
                /* CARD -> SDHC pin mux settings */
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_5_REG, 0, 0x00007c00);
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_4_REG, 0, 0x7c000000);
@@ -248,6 +253,11 @@
                CBUS_SET_CLEAR(PREG_PAD_GPIO5_EN_N_REG, 0, 0x80000000);
                break;
        case AMLOGIC_SDHC_PORT_C:
+               /* Set BOOT 0-8,10 to input */
+               CBUS_SET_CLEAR(PAD_PULL_UP_2_REG, 0x000005ff, 0);
+               CBUS_SET_CLEAR(PAD_PULL_UP_EN_2_REG, 0x000005ff, 0);
+               CBUS_SET_CLEAR(PREG_PAD_GPIO3_EN_N_REG, 0x000005ff, 0);
+
                /* BOOT -> SDHC pin mux settings */
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0, 0x04c000f0);
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_5_REG, 0, 0x00007c00);
@@ -348,6 +358,11 @@
 {
        switch (port) {
        case AMLOGIC_SDIO_PORT_B:
+               /* Set CARD 0-5 to input */
+               CBUS_SET_CLEAR(PAD_PULL_UP_2_REG, 0x03f00000, 0);
+               CBUS_SET_CLEAR(PAD_PULL_UP_EN_2_REG, 0x03f00000, 0);
+               CBUS_SET_CLEAR(PREG_PAD_GPIO0_EN_N_REG, 0x0fc00000, 0);
+
                /* CARD -> SDIO pin mux settings */
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_6_REG, 0, 0x3f000000);
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_8_REG, 0, 0x0000063f);
@@ -360,6 +375,13 @@
                CBUS_SET_CLEAR(PREG_PAD_GPIO5_EN_N_REG, 0, 0x80000000);
                break;
        case AMLOGIC_SDIO_PORT_C:
+               delay(100);
+
+               /* Set BOOT 0-8,10 to input */
+               CBUS_SET_CLEAR(PAD_PULL_UP_2_REG, 0x0000050f, 0);
+               CBUS_SET_CLEAR(PAD_PULL_UP_EN_2_REG, 0x0000050f, 0);
+               CBUS_SET_CLEAR(PREG_PAD_GPIO3_EN_N_REG, 0x0000050f, 0);
+
                /* BOOT -> SDIO pin mux settings */
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0, 0x06c2fc00);
                CBUS_SET_CLEAR(PERIPHS_PIN_MUX_8_REG, 0, 0x0000003f);



Home | Main Index | Thread Index | Old Index