Deleted Added
full compact
am335x_prcm.c (266648) am335x_prcm.c (277042)
1/*-
2 * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_prcm.c 266648 2014-05-25 10:49:07Z andrew $");
28__FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_prcm.c 277042 2015-01-12 03:23:16Z loos $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <sys/malloc.h>
36#include <sys/rman.h>

--- 76 unchanged lines hidden (view full) ---

113#define CLKSEL_TIMER7_CLK (CM_DPLL + 0x004)
114#define CLKSEL_TIMER2_CLK (CM_DPLL + 0x008)
115#define CLKSEL_TIMER3_CLK (CM_DPLL + 0x00C)
116#define CLKSEL_TIMER4_CLK (CM_DPLL + 0x010)
117#define CLKSEL_TIMER5_CLK (CM_DPLL + 0x018)
118#define CLKSEL_TIMER6_CLK (CM_DPLL + 0x01C)
119#define CLKSEL_PRUSS_OCP_CLK (CM_DPLL + 0x030)
120
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <sys/malloc.h>
36#include <sys/rman.h>

--- 76 unchanged lines hidden (view full) ---

113#define CLKSEL_TIMER7_CLK (CM_DPLL + 0x004)
114#define CLKSEL_TIMER2_CLK (CM_DPLL + 0x008)
115#define CLKSEL_TIMER3_CLK (CM_DPLL + 0x00C)
116#define CLKSEL_TIMER4_CLK (CM_DPLL + 0x010)
117#define CLKSEL_TIMER5_CLK (CM_DPLL + 0x018)
118#define CLKSEL_TIMER6_CLK (CM_DPLL + 0x01C)
119#define CLKSEL_PRUSS_OCP_CLK (CM_DPLL + 0x030)
120
121#define CM_RTC 0x800
122#define CM_RTC_RTC_CLKCTRL (CM_RTC + 0x000)
123#define CM_RTC_CLKSTCTRL (CM_RTC + 0x004)
124
121#define PRM_PER 0xC00
122#define PRM_PER_RSTCTRL (PRM_PER + 0x00)
123
124#define PRM_DEVICE_OFFSET 0xF00
125#define PRM_RSTCTRL (PRM_DEVICE_OFFSET + 0x00)
126
127struct am335x_prcm_softc {
128 struct resource * res[2];

--- 161 unchanged lines hidden (view full) ---

290 { .id = PRUSS_CLK,
291 .clk_activate = am335x_clk_pruss_activate,
292 .clk_deactivate = NULL,
293 .clk_set_source = NULL,
294 .clk_accessible = NULL,
295 .clk_get_source_freq = NULL,
296 },
297
125#define PRM_PER 0xC00
126#define PRM_PER_RSTCTRL (PRM_PER + 0x00)
127
128#define PRM_DEVICE_OFFSET 0xF00
129#define PRM_RSTCTRL (PRM_DEVICE_OFFSET + 0x00)
130
131struct am335x_prcm_softc {
132 struct resource * res[2];

--- 161 unchanged lines hidden (view full) ---

294 { .id = PRUSS_CLK,
295 .clk_activate = am335x_clk_pruss_activate,
296 .clk_deactivate = NULL,
297 .clk_set_source = NULL,
298 .clk_accessible = NULL,
299 .clk_get_source_freq = NULL,
300 },
301
302 /* RTC */
303 AM335X_GENERIC_CLOCK_DEV(RTC_CLK),
298
304
299
300 { INVALID_CLK_IDENT, NULL, NULL, NULL, NULL }
301};
302
303struct am335x_clk_details {
304 clk_ident_t id;
305 uint32_t clkctrl_reg;
306 uint32_t clksel_reg;
307};

--- 50 unchanged lines hidden (view full) ---

358 /* PWMSS modules */
359 _CLK_DETAIL(PWMSS0_CLK, CM_PER_EPWMSS0_CLKCTRL, 0),
360 _CLK_DETAIL(PWMSS1_CLK, CM_PER_EPWMSS1_CLKCTRL, 0),
361 _CLK_DETAIL(PWMSS2_CLK, CM_PER_EPWMSS2_CLKCTRL, 0),
362
363 _CLK_DETAIL(MAILBOX0_CLK, CM_PER_MAILBOX0_CLKCTRL, 0),
364 _CLK_DETAIL(SPINLOCK0_CLK, CM_PER_SPINLOCK0_CLKCTRL, 0),
365
305 { INVALID_CLK_IDENT, NULL, NULL, NULL, NULL }
306};
307
308struct am335x_clk_details {
309 clk_ident_t id;
310 uint32_t clkctrl_reg;
311 uint32_t clksel_reg;
312};

--- 50 unchanged lines hidden (view full) ---

363 /* PWMSS modules */
364 _CLK_DETAIL(PWMSS0_CLK, CM_PER_EPWMSS0_CLKCTRL, 0),
365 _CLK_DETAIL(PWMSS1_CLK, CM_PER_EPWMSS1_CLKCTRL, 0),
366 _CLK_DETAIL(PWMSS2_CLK, CM_PER_EPWMSS2_CLKCTRL, 0),
367
368 _CLK_DETAIL(MAILBOX0_CLK, CM_PER_MAILBOX0_CLKCTRL, 0),
369 _CLK_DETAIL(SPINLOCK0_CLK, CM_PER_SPINLOCK0_CLKCTRL, 0),
370
371 /* RTC module */
372 _CLK_DETAIL(RTC_CLK, CM_RTC_RTC_CLKCTRL, 0),
373
366 { INVALID_CLK_IDENT, 0},
367};
368
369/* Read/Write macros */
370#define prcm_read_4(reg) \
371 bus_space_read_4(am335x_prcm_sc->bst, am335x_prcm_sc->bsh, reg)
372#define prcm_write_4(reg, val) \
373 bus_space_write_4(am335x_prcm_sc->bst, am335x_prcm_sc->bsh, reg, val)

--- 417 unchanged lines hidden ---
374 { INVALID_CLK_IDENT, 0},
375};
376
377/* Read/Write macros */
378#define prcm_read_4(reg) \
379 bus_space_read_4(am335x_prcm_sc->bst, am335x_prcm_sc->bsh, reg)
380#define prcm_write_4(reg, val) \
381 bus_space_write_4(am335x_prcm_sc->bst, am335x_prcm_sc->bsh, reg, val)

--- 417 unchanged lines hidden ---