2006-02-04 23:32:13 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 2005 Olivier Houchard. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
2008-11-25 00:13:26 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
2006-02-04 23:32:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* $FreeBSD$ */
|
|
|
|
|
|
|
|
#ifndef _AT91VAR_H_
|
|
|
|
#define _AT91VAR_H_
|
|
|
|
|
2010-10-06 22:25:21 +00:00
|
|
|
#include <sys/bus.h>
|
2006-02-04 23:32:13 +00:00
|
|
|
#include <sys/rman.h>
|
|
|
|
|
2010-10-06 22:25:21 +00:00
|
|
|
#include <arm/at91/at91reg.h>
|
|
|
|
|
2006-02-04 23:32:13 +00:00
|
|
|
struct at91_softc {
|
|
|
|
device_t dev;
|
|
|
|
bus_space_tag_t sc_st;
|
|
|
|
bus_space_handle_t sc_sh;
|
2010-10-06 22:25:21 +00:00
|
|
|
bus_space_handle_t sc_aic_sh;
|
2006-02-04 23:32:13 +00:00
|
|
|
struct rman sc_irq_rman;
|
|
|
|
struct rman sc_mem_rman;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct at91_ivar {
|
|
|
|
struct resource_list resources;
|
|
|
|
};
|
|
|
|
|
2010-10-06 22:25:21 +00:00
|
|
|
struct cpu_devs
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
int unit;
|
|
|
|
bus_addr_t mem_base;
|
|
|
|
bus_size_t mem_len;
|
|
|
|
int irq0;
|
|
|
|
int irq1;
|
|
|
|
int irq2;
|
|
|
|
const char *parent_clk;
|
|
|
|
};
|
|
|
|
|
Enhance the Atmel SoC chip identification routines to account for more
SoC variants. Fold the AT91SAM9XE chips into the AT91SAM9260
handling, where appropriate. The following SoCs/SoC families are recognized:
at91cap9, at91rm9200, at91sam9260, at91sam9261, at91sam9263,
at91sam9g10, at91sam9g20, at91sam9g45, at91sam9n12, at91sam9rl,
at91sam9x5
and the following variations are also recognized:
at91rm9200_bga, at91rm9200_pqfp, at91sam9xe, at91sam9g45, at91sam9m10,
at91sam9g46, at91sam9m11, at91sam9g15, at91sam9g25, at91sam9g35,
at91sam9x25, at91sam9x35
This is only the identification routine: no additional Atmel devices
are supported at this time.
# With these changes, I'm able to boot to the point of identification
# on a few different Atmel SoCs that we don't yet support using the
# KB920X config file -- someday tht will be an ATMEL config file...
2012-06-06 06:19:52 +00:00
|
|
|
enum at91_soc_type {
|
|
|
|
AT91_T_NONE = 0,
|
|
|
|
AT91_T_CAP9,
|
|
|
|
AT91_T_RM9200,
|
|
|
|
AT91_T_SAM9260,
|
|
|
|
AT91_T_SAM9261,
|
|
|
|
AT91_T_SAM9263,
|
|
|
|
AT91_T_SAM9G10,
|
|
|
|
AT91_T_SAM9G20,
|
|
|
|
AT91_T_SAM9G45,
|
|
|
|
AT91_T_SAM9N12,
|
|
|
|
AT91_T_SAM9RL,
|
|
|
|
AT91_T_SAM9X5,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum at91_soc_subtype {
|
2012-07-11 20:17:14 +00:00
|
|
|
AT91_ST_ANY = -1, /* Match any type */
|
Enhance the Atmel SoC chip identification routines to account for more
SoC variants. Fold the AT91SAM9XE chips into the AT91SAM9260
handling, where appropriate. The following SoCs/SoC families are recognized:
at91cap9, at91rm9200, at91sam9260, at91sam9261, at91sam9263,
at91sam9g10, at91sam9g20, at91sam9g45, at91sam9n12, at91sam9rl,
at91sam9x5
and the following variations are also recognized:
at91rm9200_bga, at91rm9200_pqfp, at91sam9xe, at91sam9g45, at91sam9m10,
at91sam9g46, at91sam9m11, at91sam9g15, at91sam9g25, at91sam9g35,
at91sam9x25, at91sam9x35
This is only the identification routine: no additional Atmel devices
are supported at this time.
# With these changes, I'm able to boot to the point of identification
# on a few different Atmel SoCs that we don't yet support using the
# KB920X config file -- someday tht will be an ATMEL config file...
2012-06-06 06:19:52 +00:00
|
|
|
AT91_ST_NONE = 0,
|
|
|
|
/* AT91RM9200 */
|
|
|
|
AT91_ST_RM9200_BGA,
|
|
|
|
AT91_ST_RM9200_PQFP,
|
|
|
|
/* AT91SAM9260 */
|
|
|
|
AT91_ST_SAM9XE,
|
|
|
|
/* AT91SAM9G45 */
|
|
|
|
AT91_ST_SAM9G45,
|
|
|
|
AT91_ST_SAM9M10,
|
|
|
|
AT91_ST_SAM9G46,
|
|
|
|
AT91_ST_SAM9M11,
|
|
|
|
/* AT91SAM9X5 */
|
|
|
|
AT91_ST_SAM9G15,
|
|
|
|
AT91_ST_SAM9G25,
|
|
|
|
AT91_ST_SAM9G35,
|
|
|
|
AT91_ST_SAM9X25,
|
|
|
|
AT91_ST_SAM9X35,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum at91_soc_family {
|
|
|
|
AT91_FAMILY_SAM9 = 0x19,
|
|
|
|
AT91_FAMILY_SAM9XE = 0x29,
|
|
|
|
AT91_FAMILY_RM92 = 0x92,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define AT91_SOC_NAME_MAX 50
|
|
|
|
|
2012-06-15 08:37:50 +00:00
|
|
|
typedef void (*DELAY_t)(int);
|
|
|
|
typedef void (*cpu_reset_t)(void);
|
2012-07-12 13:45:58 +00:00
|
|
|
typedef void (*clk_init_t)(void);
|
2012-06-15 08:37:50 +00:00
|
|
|
|
2012-07-11 20:17:14 +00:00
|
|
|
struct at91_soc_data {
|
2014-01-15 19:53:36 +00:00
|
|
|
DELAY_t soc_delay; /* SoC specific delay function */
|
|
|
|
cpu_reset_t soc_reset; /* SoC specific reset function */
|
|
|
|
clk_init_t soc_clock_init; /* SoC specific clock init function */
|
|
|
|
const int *soc_irq_prio; /* SoC specific IRQ priorities */
|
|
|
|
const struct cpu_devs *soc_children; /* SoC specific children list */
|
|
|
|
const uint32_t *soc_pio_base; /* SoC specific PIO base registers */
|
|
|
|
size_t soc_pio_count; /* Count of PIO units (not pins) in SoC */
|
2012-07-11 20:17:14 +00:00
|
|
|
};
|
|
|
|
|
Enhance the Atmel SoC chip identification routines to account for more
SoC variants. Fold the AT91SAM9XE chips into the AT91SAM9260
handling, where appropriate. The following SoCs/SoC families are recognized:
at91cap9, at91rm9200, at91sam9260, at91sam9261, at91sam9263,
at91sam9g10, at91sam9g20, at91sam9g45, at91sam9n12, at91sam9rl,
at91sam9x5
and the following variations are also recognized:
at91rm9200_bga, at91rm9200_pqfp, at91sam9xe, at91sam9g45, at91sam9m10,
at91sam9g46, at91sam9m11, at91sam9g15, at91sam9g25, at91sam9g35,
at91sam9x25, at91sam9x35
This is only the identification routine: no additional Atmel devices
are supported at this time.
# With these changes, I'm able to boot to the point of identification
# on a few different Atmel SoCs that we don't yet support using the
# KB920X config file -- someday tht will be an ATMEL config file...
2012-06-06 06:19:52 +00:00
|
|
|
struct at91_soc_info {
|
|
|
|
enum at91_soc_type type;
|
|
|
|
enum at91_soc_subtype subtype;
|
|
|
|
enum at91_soc_family family;
|
|
|
|
uint32_t cidr;
|
|
|
|
uint32_t exid;
|
|
|
|
char name[AT91_SOC_NAME_MAX];
|
2012-07-12 19:11:37 +00:00
|
|
|
uint32_t dbgu_base;
|
2012-07-11 20:17:14 +00:00
|
|
|
struct at91_soc_data *soc_data;
|
Enhance the Atmel SoC chip identification routines to account for more
SoC variants. Fold the AT91SAM9XE chips into the AT91SAM9260
handling, where appropriate. The following SoCs/SoC families are recognized:
at91cap9, at91rm9200, at91sam9260, at91sam9261, at91sam9263,
at91sam9g10, at91sam9g20, at91sam9g45, at91sam9n12, at91sam9rl,
at91sam9x5
and the following variations are also recognized:
at91rm9200_bga, at91rm9200_pqfp, at91sam9xe, at91sam9g45, at91sam9m10,
at91sam9g46, at91sam9m11, at91sam9g15, at91sam9g25, at91sam9g35,
at91sam9x25, at91sam9x35
This is only the identification routine: no additional Atmel devices
are supported at this time.
# With these changes, I'm able to boot to the point of identification
# on a few different Atmel SoCs that we don't yet support using the
# KB920X config file -- someday tht will be an ATMEL config file...
2012-06-06 06:19:52 +00:00
|
|
|
};
|
|
|
|
|
2012-07-11 20:17:14 +00:00
|
|
|
extern struct at91_soc_info soc_info;
|
2010-10-06 22:25:21 +00:00
|
|
|
|
|
|
|
static inline int at91_is_rm92(void);
|
2012-04-14 11:29:32 +00:00
|
|
|
static inline int at91_is_sam9(void);
|
2012-04-14 17:09:38 +00:00
|
|
|
static inline int at91_is_sam9xe(void);
|
2010-10-06 22:25:21 +00:00
|
|
|
static inline int at91_cpu_is(u_int cpu);
|
|
|
|
|
2012-04-14 11:29:32 +00:00
|
|
|
static inline int
|
|
|
|
at91_is_rm92(void)
|
2010-10-06 22:25:21 +00:00
|
|
|
{
|
2012-04-14 11:29:32 +00:00
|
|
|
|
2012-07-11 20:17:14 +00:00
|
|
|
return (soc_info.type == AT91_T_RM9200);
|
2010-10-06 22:25:21 +00:00
|
|
|
}
|
|
|
|
|
2012-04-14 11:29:32 +00:00
|
|
|
static inline int
|
|
|
|
at91_is_sam9(void)
|
2010-10-06 22:25:21 +00:00
|
|
|
{
|
2012-04-14 11:29:32 +00:00
|
|
|
|
2012-07-11 20:17:14 +00:00
|
|
|
return (soc_info.family == AT91_FAMILY_SAM9);
|
2010-10-06 22:25:21 +00:00
|
|
|
}
|
|
|
|
|
2012-04-14 17:09:38 +00:00
|
|
|
static inline int
|
|
|
|
at91_is_sam9xe(void)
|
|
|
|
{
|
|
|
|
|
2012-07-11 20:17:14 +00:00
|
|
|
return (soc_info.family == AT91_FAMILY_SAM9XE);
|
2012-04-14 17:09:38 +00:00
|
|
|
}
|
|
|
|
|
2012-04-14 11:29:32 +00:00
|
|
|
static inline int
|
2010-10-06 22:25:21 +00:00
|
|
|
at91_cpu_is(u_int cpu)
|
|
|
|
{
|
2012-04-14 11:29:32 +00:00
|
|
|
|
2012-07-11 20:17:14 +00:00
|
|
|
return (soc_info.type == cpu);
|
2010-10-06 22:25:21 +00:00
|
|
|
}
|
|
|
|
|
2012-07-10 04:17:49 +00:00
|
|
|
void at91_add_child(device_t dev, int prio, const char *name, int unit,
|
|
|
|
bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2);
|
|
|
|
|
2010-10-06 22:25:21 +00:00
|
|
|
extern uint32_t at91_irq_system;
|
2009-01-22 21:54:26 +00:00
|
|
|
extern uint32_t at91_master_clock;
|
2012-05-29 03:23:18 +00:00
|
|
|
void at91_pmc_init_clock(void);
|
2014-03-08 05:03:56 +00:00
|
|
|
void at91_soc_id(void);
|
2012-05-29 03:23:18 +00:00
|
|
|
|
2006-02-04 23:32:13 +00:00
|
|
|
#endif /* _AT91VAR_H_ */
|