Date: Mon, 16 Feb 2015 19:06:31 +0000 (UTC) From: Luiz Otavio O Souza <loos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278861 - head/sys/arm/broadcom/bcm2835 Message-ID: <201502161906.t1GJ6VE9087360@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: loos Date: Mon Feb 16 19:06:31 2015 New Revision: 278861 URL: https://svnweb.freebsd.org/changeset/base/278861 Log: Add a mask to match only the relative base address of BSC controllers. This should fix the attach of BSC on RPI2 (based on andrew@ dmesg). Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Feb 16 18:43:52 2015 (r278860) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Feb 16 19:06:31 2015 (r278861) @@ -247,7 +247,7 @@ bcm_bsc_attach(device_t dev) /* Check the unit we are attaching by its base address. */ start = rman_get_start(sc->sc_mem_res); for (i = 0; i < nitems(bcm_bsc_pins); i++) { - if (bcm_bsc_pins[i].start == start) + if (bcm_bsc_pins[i].start == (start & BCM_BSC_BASE_MASK)) break; } if (i == nitems(bcm_bsc_pins)) { Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Mon Feb 16 18:43:52 2015 (r278860) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Mon Feb 16 19:06:31 2015 (r278861) @@ -35,9 +35,10 @@ struct { uint32_t scl; unsigned long start; } bcm_bsc_pins[] = { - { 0, 1, 0x20205000 }, /* BSC0 GPIO pins and base address. */ - { 2, 3, 0x20804000 } /* BSC1 GPIO pins and base address. */ + { 0, 1, 0x205000 }, /* BSC0 GPIO pins and base address. */ + { 2, 3, 0x804000 } /* BSC1 GPIO pins and base address. */ }; +#define BCM_BSC_BASE_MASK 0x00ffffff struct bcm_bsc_softc { device_t sc_dev;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502161906.t1GJ6VE9087360>