summaryrefslogtreecommitdiff
path: root/sys/arch/beagle/dev
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2011-10-21 22:55:02 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2011-10-21 22:55:02 +0000
commit026cde5447af561fc95b29550a4605285abfd894 (patch)
tree6b8477d234adaee9e0b6069ac4ae79b4c18ec2ad /sys/arch/beagle/dev
parent03d0daff730ff0f198359553449041bbf1b14e95 (diff)
Pile of diffs to improve beagle/panda status. fetching u-boot parameters
out of the register input. (with a beagle_start.S fix from uwe@) Devices now detect device_id from u-boot and decide to enable/disable themselves in the device match routine. ok uwe@
Diffstat (limited to 'sys/arch/beagle/dev')
-rw-r--r--sys/arch/beagle/dev/gptimer.c10
-rw-r--r--sys/arch/beagle/dev/intc.c10
-rw-r--r--sys/arch/beagle/dev/omap_com.c62
-rw-r--r--sys/arch/beagle/dev/omdog.c10
-rw-r--r--sys/arch/beagle/dev/omehci.c10
-rw-r--r--sys/arch/beagle/dev/omgpio.c10
-rw-r--r--sys/arch/beagle/dev/ommmc.c25
-rw-r--r--sys/arch/beagle/dev/omusbtll.c10
-rw-r--r--sys/arch/beagle/dev/prcm.c10
9 files changed, 117 insertions, 40 deletions
diff --git a/sys/arch/beagle/dev/gptimer.c b/sys/arch/beagle/dev/gptimer.c
index 8e5ae8c26e1..6c97cb593dd 100644
--- a/sys/arch/beagle/dev/gptimer.c
+++ b/sys/arch/beagle/dev/gptimer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gptimer.c,v 1.5 2011/04/07 15:30:15 miod Exp $ */
+/* $OpenBSD: gptimer.c,v 1.6 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -141,6 +141,14 @@ struct cfdriver gptimer_cd = {
int
gptimer_match(struct device *parent, void *v, void *aux)
{
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet ??? - different */
+ default:
+ return 0; /* unknown */
+ }
return (1);
}
diff --git a/sys/arch/beagle/dev/intc.c b/sys/arch/beagle/dev/intc.c
index 8506f3853fb..09786443695 100644
--- a/sys/arch/beagle/dev/intc.c
+++ b/sys/arch/beagle/dev/intc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intc.c,v 1.6 2011/09/21 10:09:07 miod Exp $ */
+/* $OpenBSD: intc.c,v 1.7 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -140,6 +140,14 @@ int intc_attached = 0;
int
intc_match(struct device *parent, void *v, void *aux)
{
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet ??? - different */
+ default:
+ return 0; /* unknown */
+ }
if (intc_attached != 0)
return 0;
diff --git a/sys/arch/beagle/dev/omap_com.c b/sys/arch/beagle/dev/omap_com.c
index d6c53e6df54..28309abdec2 100644
--- a/sys/arch/beagle/dev/omap_com.c
+++ b/sys/arch/beagle/dev/omap_com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omap_com.c,v 1.5 2011/03/22 17:46:02 deraadt Exp $ */
+/* $OpenBSD: omap_com.c,v 1.6 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
* All rights reserved.
@@ -68,33 +68,47 @@ int
omapuart_match(struct device *parent, void *cf, void *aux)
{
struct ahb_attach_args *aa = aux;
- bus_space_tag_t bt = &armv7_a4x_bs_tag; /* XXX: This sucks */
- bus_space_handle_t bh;
- int rv;
+ extern uint32_t board_id;
+ int rv = 0;
/* XXX */
- if (aa->aa_addr == 0x4806A000 && aa->aa_intr == 72)
- return 1;
- if (aa->aa_addr == 0x4806C000 && aa->aa_intr == 73)
- return 1;
- if (aa->aa_addr == 0x4806E000 && aa->aa_intr == 74)
- return 1;
- {
- extern bus_addr_t comconsaddr;
-
- if (comconsaddr == aa->aa_addr)
- return (1);
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ if (aa->aa_addr == 0x4806A000 && aa->aa_intr == 72) {
+ rv = 1;
+ break;
+ }
+ if (aa->aa_addr == 0x4806C000 && aa->aa_intr == 73) {
+ rv = 1;
+ break;
+ }
+ if (aa->aa_addr == 0x49020000 && aa->aa_intr == 74) {
+ rv = 1;
+ break;
+ }
+ break;
+ case BOARD_ID_OMAP4_PANDA:
+ if (aa->aa_addr == 0x4806A000 && aa->aa_intr == 72) {
+ rv = 1;
+ break;
+ }
+ if (aa->aa_addr == 0x4806C000 && aa->aa_intr == 73) {
+ rv = 1;
+ break;
+ }
+ if (aa->aa_addr == 0x48020000 && aa->aa_intr == 74) {
+ rv = 1;
+ break;
+ }
+ if (aa->aa_addr == 0x4806E000 && aa->aa_intr == 70) {
+ rv = 1;
+ break;
+ }
+ break;
+ default:
+ printf("unknown boardid %d", board_id);
}
- if (bus_space_map(bt, aa->aa_addr, aa->aa_size, 0, &bh))
- return (0);
-
- /* Make sure the UART is enabled - XXX */
- bus_space_write_1(bt, bh, com_ier, IER_EUART);
-
- rv = comprobe1(bt, bh);
- bus_space_unmap(bt, bh, aa->aa_size);
-
return (rv);
}
diff --git a/sys/arch/beagle/dev/omdog.c b/sys/arch/beagle/dev/omdog.c
index 283829eb4f2..ddeb98a1802 100644
--- a/sys/arch/beagle/dev/omdog.c
+++ b/sys/arch/beagle/dev/omdog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omdog.c,v 1.1 2009/05/08 03:13:26 drahn Exp $ */
+/* $OpenBSD: omdog.c,v 1.2 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -73,6 +73,14 @@ struct cfdriver omdog_cd = {
int
omdog_match(struct device *parent, void *v, void *aux)
{
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet */
+ default:
+ return 0; /* unknown */
+ }
return (1);
}
diff --git a/sys/arch/beagle/dev/omehci.c b/sys/arch/beagle/dev/omehci.c
index 37396d367f2..ed602089a22 100644
--- a/sys/arch/beagle/dev/omehci.c
+++ b/sys/arch/beagle/dev/omehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omehci.c,v 1.5 2011/03/14 14:20:58 jasper Exp $ */
+/* $OpenBSD: omehci.c,v 1.6 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -62,6 +62,14 @@ omehci_match(struct device *parent, void *match, void *aux)
{
struct ahb_attach_args *aa = aux;
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet ??? - different */
+ default:
+ return 0; /* unknown */
+ }
if (aa->aa_addr != EHCI_HCPCAPBASE)
return 0;
diff --git a/sys/arch/beagle/dev/omgpio.c b/sys/arch/beagle/dev/omgpio.c
index cd396333b9c..14623fcb09a 100644
--- a/sys/arch/beagle/dev/omgpio.c
+++ b/sys/arch/beagle/dev/omgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omgpio.c,v 1.4 2010/09/20 06:33:48 matthew Exp $ */
+/* $OpenBSD: omgpio.c,v 1.5 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -102,6 +102,14 @@ struct cfdriver omgpio_cd = {
int
omgpio_match(struct device *parent, void *v, void *aux)
{
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet ??? - different */
+ default:
+ return 0; /* unknown */
+ }
return (1);
}
diff --git a/sys/arch/beagle/dev/ommmc.c b/sys/arch/beagle/dev/ommmc.c
index b4f9bfcf8e0..3b1a8696b8e 100644
--- a/sys/arch/beagle/dev/ommmc.c
+++ b/sys/arch/beagle/dev/ommmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ommmc.c,v 1.8 2010/09/06 19:20:19 deraadt Exp $ */
+/* $OpenBSD: ommmc.c,v 1.9 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
@@ -353,14 +353,21 @@ ommmc_match(struct device *parent, void *v, void *aux)
{
struct ahb_attach_args *aa = aux;
/* XXX */
- if (aa->aa_addr == MMCHS1_ADDR && aa->aa_intr == 83)
- return 1;
- else if (aa->aa_addr == MMCHS2_ADDR && aa->aa_intr == 86)
- return 1;
- else if (aa->aa_addr == MMCHS3_ADDR && aa->aa_intr == 94)
- return 1;
- else
- return (0);
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ if (aa->aa_addr == MMCHS1_ADDR && aa->aa_intr == 83)
+ return 1;
+ else if (aa->aa_addr == MMCHS2_ADDR && aa->aa_intr == 86)
+ return 1;
+ else if (aa->aa_addr == MMCHS3_ADDR && aa->aa_intr == 94)
+ return 1;
+ break;
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet ??? - different */
+ default:
+ return 0; /* unknown */
+ }
+ return (0);
}
void
diff --git a/sys/arch/beagle/dev/omusbtll.c b/sys/arch/beagle/dev/omusbtll.c
index 2110fded662..40f6e515ddd 100644
--- a/sys/arch/beagle/dev/omusbtll.c
+++ b/sys/arch/beagle/dev/omusbtll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omusbtll.c,v 1.1 2011/03/14 15:09:28 drahn Exp $ */
+/* $OpenBSD: omusbtll.c,v 1.2 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2010 Dale Rahn <drahn@openbsd.org>
*
@@ -110,6 +110,14 @@ struct cfdriver omusbtll_cd = {
int
omusbtll_match(struct device *parent, void *v, void *aux)
{
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet ??? - different */
+ default:
+ return 0; /* unknown */
+ }
return (1);
}
diff --git a/sys/arch/beagle/dev/prcm.c b/sys/arch/beagle/dev/prcm.c
index 622aad93dd1..02ab214aaa9 100644
--- a/sys/arch/beagle/dev/prcm.c
+++ b/sys/arch/beagle/dev/prcm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prcm.c,v 1.6 2011/09/18 20:02:25 miod Exp $ */
+/* $OpenBSD: prcm.c,v 1.7 2011/10/21 22:55:01 drahn Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -178,6 +178,14 @@ int
prcm_match(struct device *parent, void *v, void *aux)
{
/* only attach once */
+ switch (board_id) {
+ case BOARD_ID_OMAP3_BEAGLE:
+ break; /* continue trying */
+ case BOARD_ID_OMAP4_PANDA:
+ return 0; /* not ported yet */
+ default:
+ return 0; /* unknown */
+ }
if (prcm_attached != 0)
return (0);
return (1);