summaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
blob: 20d83bb74891bd697f3ed2fd5da2ec9d4109ebe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 *  Atheros AR71xx SoC specific platform definitions
 *
 *  Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
 *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 */

#ifndef __ASM_MACH_AR71XX_PLATFORM_H
#define __ASM_MACH_AR71XX_PLATFORM_H

#include <linux/if_ether.h>
#include <linux/skbuff.h>
#include <linux/phy.h>
#include <linux/spi/spi.h>
#include <linux/leds.h>
#include <linux/gpio_buttons.h>

struct ag71xx_platform_data {
	phy_interface_t	phy_if_mode;
	u32		phy_mask;
	int		speed;
	int		duplex;
	u32		reset_bit;
	u32		mii_if;
	u8		mac_addr[ETH_ALEN];

	u8		has_gbit:1;
	u8		is_ar91xx:1;

	void		(* ddr_flush)(void);
	void		(* set_pll)(u32 pll);
};

struct ag71xx_mdio_platform_data {
	u32		phy_mask;
};

struct ar71xx_ehci_platform_data {
	u8		is_ar91xx;
};

struct ar71xx_spi_platform_data {
	unsigned	bus_num;
	unsigned	num_chipselect;
	u32		(*get_ioc_base)(u8 chip_select, int cs_high, int is_on);
};

#define AR71XX_SPI_CS_INACTIVE	0
#define AR71XX_SPI_CS_ACTIVE	1

extern void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
				struct spi_board_info const *info,
				unsigned n) __init;

extern void ar71xx_set_mac_base(unsigned char *mac) __init;
extern void ar71xx_parse_mac_addr(char *mac_str) __init;

extern struct ag71xx_platform_data ar71xx_eth0_data;
extern struct ag71xx_platform_data ar71xx_eth1_data;
extern void ar71xx_add_device_eth(unsigned int id) __init;

extern void ar71xx_add_device_mdio(u32 phy_mask) __init;

extern void ar71xx_add_device_leds_gpio(int id,
				   unsigned num_leds,
				   struct gpio_led *leds) __init;

extern void ar71xx_add_device_gpio_buttons(int id,
				   unsigned poll_interval,
				   unsigned nbuttons,
				   struct gpio_button *buttons) __init;

#ifdef CONFIG_AR71XX_EARLY_SERIAL
static inline void ar71xx_add_device_uart(void) {}
#else
extern void ar71xx_add_device_uart(void) __init;
#endif

extern void ar71xx_add_device_wdt(void) __init;

extern void ar91xx_add_device_wmac(void) __init;

#endif /* __ASM_MACH_AR71XX_PLATFORM_H */