From owner-svn-src-all@FreeBSD.ORG Sat Apr 14 17:17:55 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 DF9151065672; Sat, 14 Apr 2012 17:17:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16C38FC0C; Sat, 14 Apr 2012 17:17:55 +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 q3EHHtXP039773; Sat, 14 Apr 2012 17:17:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EHHtmx039771; Sat, 14 Apr 2012 17:17:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204141717.q3EHHtmx039771@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 Apr 2012 17:17:55 +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: r234292 - 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: Sat, 14 Apr 2012 17:17:56 -0000 Author: marius Date: Sat Apr 14 17:17:55 2012 New Revision: 234292 URL: http://svn.freebsd.org/changeset/base/234292 Log: Add support for the Atmel SAM9XE familiy of microcontrollers, which consist of a ARM926EJ-S processor core with up to 512 Kbytes of on-chip flash. Tested with SAM9XE512. This file was missed in r234291. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sat Apr 14 17:09:38 2012 (r234291) +++ head/sys/arm/at91/at91_pmc.c Sat Apr 14 17:17:55 2012 (r234292) @@ -162,12 +162,14 @@ static const unsigned int at91_mainf_tbl static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct at91_pmc_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -225,7 +227,8 @@ at91_pmc_set_periph_mode(struct at91_pmc } struct at91_pmc_clock * -at91_pmc_clock_add(const char *name, uint32_t irq, struct at91_pmc_clock *parent) +at91_pmc_clock_add(const char *name, uint32_t irq, + struct at91_pmc_clock *parent) { struct at91_pmc_clock *clk; int i, buflen; @@ -299,11 +302,13 @@ at91_pmc_clock_ref(const char *name) void at91_pmc_clock_deref(struct at91_pmc_clock *clk) { + } void at91_pmc_clock_enable(struct at91_pmc_clock *clk) { + /* XXX LOCKING? XXX */ if (clk->parent) at91_pmc_clock_enable(clk->parent); @@ -314,6 +319,7 @@ at91_pmc_clock_enable(struct at91_pmc_cl void at91_pmc_clock_disable(struct at91_pmc_clock *clk) { + /* XXX LOCKING? XXX */ if (--clk->refcnt == 0 && clk->set_mode) clk->set_mode(clk, 0); @@ -342,7 +348,6 @@ at91_pmc_pll_rate(struct at91_pmc_clock freq = 0; clk->hz = freq; - return (freq); } @@ -402,7 +407,7 @@ at91_pmc_init_clock(struct at91_pmc_soft uint32_t mckr; uint32_t mdiv; - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { uhpck.pmc_mask = PMC_SCER_UHP_SAM9; udpck.pmc_mask = PMC_SCER_UDP_SAM9; } @@ -446,7 +451,7 @@ at91_pmc_init_clock(struct at91_pmc_soft (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { if (mdiv > 0) mck.hz /= mdiv * 2; } else @@ -486,7 +491,6 @@ at91_pmc_deactivate(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, rman_get_rid(sc->mem_res), sc->mem_res); sc->mem_res = 0; - return; } static int