From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 19:48:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BC52106566B; Tue, 10 Jul 2012 19:48:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67A948FC14; Tue, 10 Jul 2012 19:48:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6AJmhQL000197; Tue, 10 Jul 2012 19:48:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AJmhUk000191; Tue, 10 Jul 2012 19:48:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207101948.q6AJmhUk000191@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 19:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238354 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 19:48:43 -0000 Author: imp Date: Tue Jul 10 19:48:42 2012 New Revision: 238354 URL: http://svn.freebsd.org/changeset/base/238354 Log: Go ahead and disable the interrupts for the DBGU the boot loader may have left enabled after we detect the CPU, and remove the multiplely copied code from the SoC modules. Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91_machdep.c Tue Jul 10 19:48:42 2012 (r238354) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -382,6 +383,14 @@ at91_try_id(uint32_t dbgu_base) default: break; } + /* + * Disable interrupts + */ + *(volatile uint32_t *)(AT91_BASE + dbgu_base + USART_IDR) = 0xffffffff; + + /* + * Save the name for later... + */ snprintf(soc_data.name, sizeof(soc_data.name), "%s%s%s", soc_type_name[soc_data.type], soc_data.subtype == AT91_ST_NONE ? "" : " subtype ", Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91rm92_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; /* @@ -194,10 +193,6 @@ at91_attach(device_t dev) AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_DBGU_BASE, - AT91RM92_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_AIC_BASE, AT91RM92_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -229,9 +224,6 @@ at91_attach(device_t dev) /* Disable all interrupts for the SDRAM controller */ bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); clk->pmc_mask = PMC_SCER_UDP; Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91sam9_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; @@ -194,10 +193,6 @@ at91_attach(device_t dev) AT91SAM9260_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_DBGU_BASE, - AT91SAM9260_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_AIC_BASE, AT91SAM9260_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -223,9 +218,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91sam9_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; @@ -205,10 +204,6 @@ at91_attach(device_t dev) AT91SAM9G20_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_DBGU_BASE, - AT91SAM9G20_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_AIC_BASE, AT91SAM9G20_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -234,9 +229,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91sam9x25_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; @@ -208,10 +207,6 @@ at91_attach(device_t dev) AT91SAM9X25_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_DBGU_BASE, - AT91SAM9X25_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_AIC_BASE, AT91SAM9X25_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -237,9 +232,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_MATRIX_BASE, AT91SAM9X25_MATRIX_SIZE, &sc->sc_matrix_sh) != 0)