summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-03-29 03:24:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-03-29 03:24:18 +0000
commit0eec05b0f45e7a6491fed03668062fb1f2ebedc6 (patch)
treeec5420ca9b755cd89264aa19d2cf6cd58ce464d9 /sys
parent266c25a8717dc83a3cce48a03a22cb6620dde9e9 (diff)
initial support for the SABRE SD board
from Patrick Wildt in Bitrig
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/armv7/armv7/armv7.c30
-rw-r--r--sys/arch/armv7/armv7/armv7var.h3
-rw-r--r--sys/arch/armv7/imx/imx_machdep.c18
-rw-r--r--sys/arch/armv7/imx/imxehci.c8
-rw-r--r--sys/arch/armv7/imx/imxenet.c15
-rw-r--r--sys/arch/armv7/imx/imxesdhc.c17
6 files changed, 81 insertions, 10 deletions
diff --git a/sys/arch/armv7/armv7/armv7.c b/sys/arch/armv7/armv7/armv7.c
index 342dd157c1e..db47259b09a 100644
--- a/sys/arch/armv7/armv7/armv7.c
+++ b/sys/arch/armv7/armv7/armv7.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7.c,v 1.4 2015/01/02 01:57:33 jsg Exp $ */
+/* $OpenBSD: armv7.c,v 1.5 2015/03/29 03:24:17 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -110,6 +110,29 @@ struct board_dev sabrelite_devs[] = {
{ NULL, 0 }
};
+struct board_dev sabresd_devs[] = {
+ { "imxocotp", 0 },
+ { "imxccm", 0 },
+ { "imxtemp", 0 },
+ { "imxiomuxc", 0 },
+ { "imxdog", 0 },
+ { "imxuart", 0 },
+ { "imxgpio", 0 },
+ { "imxgpio", 1 },
+ { "imxgpio", 2 },
+ { "imxgpio", 3 },
+ { "imxgpio", 4 },
+ { "imxgpio", 5 },
+ { "imxgpio", 6 },
+ { "imxesdhc", 1 },
+ { "imxesdhc", 2 },
+ { "imxesdhc", 3 },
+ { "ehci", 0 },
+ { "imxenet", 0 },
+ { "ahci", 0 },
+ { NULL, 0 }
+};
+
struct board_dev udoo_devs[] = {
{ "imxocotp", 0 },
{ "imxccm", 0 },
@@ -374,6 +397,11 @@ armv7_attach(struct device *parent, struct device *self, void *aux)
imx6_init();
sc->sc_board_devs = sabrelite_devs;
break;
+ case BOARD_ID_IMX6_SABRESD:
+ printf(": i.MX6 SABRE SD\n");
+ imx6_init();
+ sc->sc_board_devs = sabresd_devs;
+ break;
case BOARD_ID_IMX6_UDOO:
printf(": i.MX6 UDOO\n");
imx6_init();
diff --git a/sys/arch/armv7/armv7/armv7var.h b/sys/arch/armv7/armv7/armv7var.h
index 65a38222f97..f232506f29b 100644
--- a/sys/arch/armv7/armv7/armv7var.h
+++ b/sys/arch/armv7/armv7/armv7var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7var.h,v 1.2 2015/01/02 01:57:33 jsg Exp $ */
+/* $OpenBSD: armv7var.h,v 1.3 2015/03/29 03:24:17 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -74,6 +74,7 @@ int armv7_submatch(struct device *, void *, void *);
#define BOARD_ID_IMX6_PHYFLEX 3529
#define BOARD_ID_AM335X_BEAGLEBONE 3589
#define BOARD_ID_IMX6_SABRELITE 3769
+#define BOARD_ID_IMX6_SABRESD 3980
#define BOARD_ID_SUN4I_A10 4104
#define BOARD_ID_IMX6_UTILITE 4273
#define BOARD_ID_SUN7I_A20 4283
diff --git a/sys/arch/armv7/imx/imx_machdep.c b/sys/arch/armv7/imx/imx_machdep.c
index de89a6e6ff5..684c3a6bbd7 100644
--- a/sys/arch/armv7/imx/imx_machdep.c
+++ b/sys/arch/armv7/imx/imx_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imx_machdep.c,v 1.10 2015/01/22 14:33:01 krw Exp $ */
+/* $OpenBSD: imx_machdep.c,v 1.11 2015/03/29 03:24:17 jsg Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -52,19 +52,23 @@ platform_init_cons(void)
paddr_t paddr;
switch (board_id) {
+ /* UART1 */
case BOARD_ID_IMX6_CUBOXI:
case BOARD_ID_IMX6_HUMMINGBOARD:
+ case BOARD_ID_IMX6_SABRESD:
case BOARD_ID_IMX6_WANDBOARD:
paddr = 0x02020000;
break;
- case BOARD_ID_IMX6_PHYFLEX:
- case BOARD_ID_IMX6_UTILITE:
- paddr = 0x021f0000;
- break;
+ /* UART2 */
case BOARD_ID_IMX6_SABRELITE:
case BOARD_ID_IMX6_UDOO:
paddr = 0x021e8000;
break;
+ /* UART4 */
+ case BOARD_ID_IMX6_PHYFLEX:
+ case BOARD_ID_IMX6_UTILITE:
+ paddr = 0x021f0000;
+ break;
default:
printf("board type %x unknown", board_id);
return;
@@ -105,6 +109,10 @@ platform_print_board_type(void)
amptimer_frequency = 396 * 1000 * 1000;
printf("board type: SABRE Lite\n");
break;
+ case BOARD_ID_IMX6_SABRESD:
+ amptimer_frequency = 396 * 1000 * 1000;
+ printf("board type: SABRE SD\n");
+ break;
case BOARD_ID_IMX6_UDOO:
amptimer_frequency = 396 * 1000 * 1000;
printf("board type: UDOO\n");
diff --git a/sys/arch/armv7/imx/imxehci.c b/sys/arch/armv7/imx/imxehci.c
index 6bc4c2ec5ce..0de9785fac9 100644
--- a/sys/arch/armv7/imx/imxehci.c
+++ b/sys/arch/armv7/imx/imxehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxehci.c,v 1.6 2015/01/17 02:57:16 jsg Exp $ */
+/* $OpenBSD: imxehci.c,v 1.7 2015/03/29 03:24:17 jsg Exp $ */
/*
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
*
@@ -67,6 +67,7 @@
#define EHCI_NITROGEN6X_USB_HUB_RST (6*32+12)
#define EHCI_PHYFLEX_USB_H1_PWR 0
#define EHCI_PHYFLEX_USB_OTG_PWR 111
+#define EHCI_SABRESD_USB_PWR (0*32+29)
#define EHCI_UTILITE_USB_HUB_RST (6*32+8)
void imxehci_attach(struct device *, struct device *, void *);
@@ -146,6 +147,11 @@ imxehci_attach(struct device *parent, struct device *self, void *aux)
imxgpio_set_bit(EHCI_NITROGEN6X_USB_HUB_RST);
delay(10);
break;
+ case BOARD_ID_IMX6_SABRESD:
+ imxgpio_set_bit(EHCI_SABRESD_USB_PWR);
+ imxgpio_set_dir(EHCI_SABRESD_USB_PWR, IMXGPIO_DIR_OUT);
+ delay(10);
+ break;
case BOARD_ID_IMX6_UTILITE:
imxgpio_clear_bit(EHCI_UTILITE_USB_HUB_RST);
imxgpio_set_dir(EHCI_UTILITE_USB_HUB_RST, IMXGPIO_DIR_OUT);
diff --git a/sys/arch/armv7/imx/imxenet.c b/sys/arch/armv7/imx/imxenet.c
index 66c442bbe72..556b4609678 100644
--- a/sys/arch/armv7/imx/imxenet.c
+++ b/sys/arch/armv7/imx/imxenet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxenet.c,v 1.11 2015/03/18 13:33:55 mpi Exp $ */
+/* $OpenBSD: imxenet.c,v 1.12 2015/03/29 03:24:17 jsg Exp $ */
/*
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
*
@@ -136,6 +136,8 @@
#define ENET_HUMMINGBOARD_PHY_RST (3*32+15)
#define ENET_SABRELITE_PHY 6
#define ENET_SABRELITE_PHY_RST (2*32+23)
+#define ENET_SABRESD_PHY 1
+#define ENET_SABRESD_PHY_RST (0*32+25)
#define ENET_NITROGEN6X_PHY 6
#define ENET_NITROGEN6X_PHY_RST (0*32+27)
#define ENET_UDOO_PHY 6
@@ -255,6 +257,13 @@ imxenet_attach(struct device *parent, struct device *self, void *args)
imxgpio_set_bit(ENET_NITROGEN6X_PHY_RST);
delay(100);
break;
+ case BOARD_ID_IMX6_SABRESD:
+ imxgpio_clear_bit(ENET_SABRESD_PHY_RST);
+ imxgpio_set_dir(ENET_SABRESD_PHY_RST, IMXGPIO_DIR_OUT);
+ delay(1000 * 10);
+ imxgpio_set_bit(ENET_SABRESD_PHY_RST);
+ delay(100);
+ break;
case BOARD_ID_IMX6_UDOO:
imxgpio_set_bit(ENET_UDOO_PWR);
imxgpio_set_dir(ENET_UDOO_PWR, IMXGPIO_DIR_OUT);
@@ -398,6 +407,9 @@ imxenet_chip_init(struct imxenet_softc *sc)
case BOARD_ID_IMX6_SABRELITE:
phy = ENET_SABRELITE_PHY;
break;
+ case BOARD_ID_IMX6_SABRESD:
+ phy = ENET_SABRESD_PHY;
+ break;
case BOARD_ID_IMX6_UDOO:
phy = ENET_UDOO_PHY;
break;
@@ -462,6 +474,7 @@ imxenet_chip_init(struct imxenet_softc *sc)
break;
case BOARD_ID_IMX6_CUBOXI: /* AR8035 */
case BOARD_ID_IMX6_HUMMINGBOARD: /* AR8035 */
+ case BOARD_ID_IMX6_SABRESD: /* AR8031 */
case BOARD_ID_IMX6_UTILITE:
case BOARD_ID_IMX6_WANDBOARD: /* AR8031 */
/* disable SmartEEE */
diff --git a/sys/arch/armv7/imx/imxesdhc.c b/sys/arch/armv7/imx/imxesdhc.c
index 6d5c8cdcaea..17f57820153 100644
--- a/sys/arch/armv7/imx/imxesdhc.c
+++ b/sys/arch/armv7/imx/imxesdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxesdhc.c,v 1.5 2015/01/02 01:57:33 jsg Exp $ */
+/* $OpenBSD: imxesdhc.c,v 1.6 2015/03/29 03:24:17 jsg Exp $ */
/*
* Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -465,6 +465,21 @@ imxesdhc_card_detect(sdmmc_chipset_handle_t sch)
return 0;
}
return imxgpio_get_bit(gpio) ? 0 : 1;
+ case BOARD_ID_IMX6_SABRESD:
+ switch (sc->unit) {
+ case 1:
+ gpio = 1*32 + 2;
+ break;
+ case 2:
+ gpio = 1*32 + 0;
+ break;
+ case 3:
+ return 1;
+ default:
+ return 0;
+ }
+ imxgpio_set_dir(gpio, IMXGPIO_DIR_IN);
+ return imxgpio_get_bit(gpio) ? 0 : 1;
case BOARD_ID_IMX6_UDOO:
switch (sc->unit) {
/*