Implement architecture speficic GPIO calls for adm5120, thanks to Gabor Juhos
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7286 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
47d9fd249a
commit
95856e52e1
|
@ -17,6 +17,7 @@ CONFIG_CMDLINE="console=ttyS0,115200 rootfs=jffs2,squashfs init=/etc/preinit"
|
|||
CONFIG_CPU_HAS_LLSC=y
|
||||
CONFIG_CPU_HAS_PREFETCH=y
|
||||
CONFIG_CPU_HAS_SYNC=y
|
||||
CONFIG_GENERIC_GPIO=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_MIPS32=y
|
||||
CONFIG_CPU_MIPS32_R1=y
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
#
|
||||
|
||||
obj-y := setup.o prom.o irq.o memory.o int-handler.o adm5120_info.o
|
||||
obj-y += gpio.o
|
||||
|
||||
EXTRA_AFLAGS := $(CFLAGS)
|
||||
|
|
|
@ -52,6 +52,16 @@ extern unsigned int adm5120_package;
|
|||
|
||||
extern void adm5120_info_init(void);
|
||||
|
||||
static inline int adm5120_package_pqfp(void)
|
||||
{
|
||||
return (adm5120_package == ADM5120_PACKAGE_PQFP);
|
||||
}
|
||||
|
||||
static inline int adm5120_package_bga(void)
|
||||
{
|
||||
return (adm5120_package == ADM5120_PACKAGE_BGA);
|
||||
}
|
||||
|
||||
static inline int adm5120_has_pci(void)
|
||||
{
|
||||
return (adm5120_package == ADM5120_PACKAGE_BGA);
|
||||
|
|
|
@ -85,5 +85,37 @@
|
|||
#define CODE_PK_BGA 0 /* BGA package */
|
||||
#define CODE_PK_PQFP 1 /* PQFP package */
|
||||
|
||||
/* GPIO_CONF0 register bits */
|
||||
#define GPIO_CONF0_MASK BITMASK(8)
|
||||
#define GPIO_CONF0_IM_SHIFT 0
|
||||
#define GPIO_CONF0_IV_SHIFT 8
|
||||
#define GPIO_CONF0_OE_SHIFT 16
|
||||
#define GPIO_CONF0_OV_SHIFT 24
|
||||
#define GPIO_CONF0_IM_MASK (0xFF << GPIO_CONF0_IM_SHIFT)
|
||||
#define GPIO_CONF0_IV_MASK (0xFF << GPIO_CONF0_IV_SHIFT)
|
||||
#define GPIO_CONF0_OE_MASK (0xFF << GPIO_CONF0_OE_SHIFT)
|
||||
#define GPIO_CONF0_OV_MASK (0xFF << GPIO_CONF0_OV_SHIFT)
|
||||
|
||||
/* PORTx_LED register bits */
|
||||
#define LED_MODE_MASK BITMASK(4)
|
||||
#define LED_MODE_INPUT 0
|
||||
#define LED_MODE_FLASH 1
|
||||
#define LED_MODE_OUT_HIGH 2
|
||||
#define LED_MODE_OUT_LOW 3
|
||||
#define LED_MODE_LINK 4
|
||||
#define LED_MODE_SPEED 5
|
||||
#define LED_MODE_DUPLEX 6
|
||||
#define LED_MODE_ACT 7
|
||||
#define LED_MODE_COLL 8
|
||||
#define LED_MODE_LINK_ACT 9
|
||||
#define LED_MODE_DUPLEX_COLL 10
|
||||
#define LED_MODE_10M_ACT 11
|
||||
#define LED_MODE_100M_ACT 12
|
||||
#define LED0_MODE_SHIFT 0 /* LED0 mode shift */
|
||||
#define LED1_MODE_SHIFT 4 /* LED1 mode shift */
|
||||
#define LED2_MODE_SHIFT 8 /* LED2 mode shift */
|
||||
#define LED0_IV_SHIFT 12 /* LED0 input value shift */
|
||||
#define LED1_IV_SHIFT 13 /* LED1 input value shift */
|
||||
#define LED2_IV_SHIFT 14 /* LED2 input value shift */
|
||||
|
||||
#endif /* _ADM5120_SWITCH_H */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
diff -urN linux-2.6.19.2/arch/mips/Kconfig linux-2.6.19.2.new/arch/mips/Kconfig
|
||||
--- linux-2.6.19.2/arch/mips/Kconfig 2007-01-10 20:10:37.000000000 +0100
|
||||
+++ linux-2.6.19.2.new/arch/mips/Kconfig 2007-01-23 14:49:38.000000000 +0100
|
||||
@@ -12,6 +12,19 @@
|
||||
@@ -12,6 +12,20 @@
|
||||
prompt "System type"
|
||||
default SGI_IP22
|
||||
|
||||
|
@ -13,6 +13,7 @@ diff -urN linux-2.6.19.2/arch/mips/Kconfig linux-2.6.19.2.new/arch/mips/Kconfig
|
|||
+ select SYS_SUPPORTS_LITTLE_ENDIAN
|
||||
+ select SYS_SUPPORTS_BIG_ENDIAN
|
||||
+ select SYS_SUPPORTS_32BIT_KERNEL
|
||||
+ select GENERIC_GPIO
|
||||
+
|
||||
+config PCI_ADM5120
|
||||
+ bool "Add PCI control support for ADM5120"
|
||||
|
|
|
@ -17,6 +17,7 @@ CONFIG_CPU_BIG_ENDIAN=y
|
|||
CONFIG_CPU_HAS_LLSC=y
|
||||
CONFIG_CPU_HAS_PREFETCH=y
|
||||
CONFIG_CPU_HAS_SYNC=y
|
||||
CONFIG_GENERIC_GPIO=y
|
||||
# CONFIG_CPU_LITTLE_ENDIAN is not set
|
||||
CONFIG_CPU_MIPS32=y
|
||||
CONFIG_CPU_MIPS32_R1=y
|
||||
|
|
Loading…
Reference in New Issue