diff options
author | Artur Artamonov <freeartman@wechall.net> | 2013-09-27 11:20:56 +0300 |
---|---|---|
committer | Artur Artamonov <freeartman@wechall.net> | 2013-09-27 11:20:56 +0300 |
commit | 121949f8fc696103181b55c205c19f92b53c4968 (patch) | |
tree | ce4e97a5722374c3a6b91536a0cb34d537fa5a59 /target/linux/realtek/files | |
parent | 4ea5be035a3e211bb9a34811326863144773a524 (diff) |
USB initialisation in arch/rlx/bsp_XXXX/setup.c files
Diffstat (limited to 'target/linux/realtek/files')
10 files changed, 167 insertions, 58 deletions
diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/Makefile b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/Makefile index ca3266bc8..9d8a06afd 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/Makefile +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/Makefile @@ -1,27 +1,17 @@ -# Realtek Semiconductor Corp. -# -# Tony Wu (tonywu@realtek.com) -# Oct. 18, 2008 -# +include $(TOPDIR)/.config -# -# RTL8196C -# -include $(DIR_LINUX)/.config - -core-y += arch/rlx/bsp/ cflags-y += -Iinclude/asm-rlx -Iarch/rlx/bsp/ #load-y += 0xffffffff80000000 load-y += 0x80000000 extra-y += vmlinux.lds -obj-y := prom.o setup.o irq.o timer.o serial.o +obj-y := irq.o prom.o serial.o setup.o timer.o dev_usb.o obj-$(CONFIG_PCI) += pci.o EXTRA_AFLAGS := $(CFLAGS) -EXTRA_CFLAGS += -I$(DIR_LINUX)/drivers/net/rtl819x/AsicDriver -EXTRA_CFLAGS += -I$(DIR_LINUX)/drivers/net/rtl819x/common +EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/rtl819x/AsicDriver +EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/rtl819x/common ifdef CONFIG_RTL_819X_SWCORE EXTRA_CFLAGS += -DCONFIG_RTL_819X_SWCORE endif diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/bspchip.h b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/bspchip.h index 0f65e1945..887d87154 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/bspchip.h +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/bspchip.h @@ -11,24 +11,10 @@ #ifndef _BSPCHIP_H_ #define _BSPCHIP_H_ +#include "rlxhack.h" + #include <linux/autoconf.h> #define RTL8196C 1 -/* - * Register access macro - */ -#define REG32(reg) (*(volatile unsigned int *)((unsigned int)reg)) -#define REG16(reg) (*(volatile unsigned short *)((unsigned int)reg)) -#define REG08(reg) (*(volatile unsigned char *)((unsigned int)reg)) -#define REG8(reg) (*(volatile unsigned char *)((unsigned int)reg)) - -#define WRITE_MEM32(addr, val) (*(volatile unsigned int *) (addr)) = (val) -#define READ_MEM32(addr) (*(volatile unsigned int *) (addr)) -#define WRITE_MEM16(addr, val) (*(volatile unsigned short *) (addr)) = (val) -#define READ_MEM16(addr) (*(volatile unsigned short *) (addr)) -#define WRITE_MEM8(addr, val) (*(volatile unsigned char *) (addr)) = (val) -#define READ_MEM8(addr) (*(volatile unsigned char *) (addr)) - -#define PADDR(addr) ((addr) & 0x1FFFFFFF) /* * IRQ Controller diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/rlxhack.h b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/rlxhack.h new file mode 100644 index 000000000..450b3bb9c --- /dev/null +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/rlxhack.h @@ -0,0 +1,70 @@ +#ifndef __RLXHACK_H +#define __RLXHACK_H + +/* + * Register access macro + */ +#ifndef REG32 +#define REG32(reg) (*(volatile unsigned int *)((unsigned int)reg)) +#define REG16(reg) (*(volatile unsigned short *)((unsigned int)reg)) +#define REG08(reg) (*(volatile unsigned char *)((unsigned int)reg)) +#define REG8(reg) (*(volatile unsigned char *)((unsigned int)reg)) + +#define WRITE_MEM32(addr, val) (*(volatile unsigned int *) (addr)) = (val) +#define READ_MEM32(addr) (*(volatile unsigned int *) (addr)) +#define WRITE_MEM16(addr, val) (*(volatile unsigned short *) (addr)) = (val) +#define READ_MEM16(addr) (*(volatile unsigned short *) (addr)) +#define WRITE_MEM8(addr, val) (*(volatile unsigned char *) (addr)) = (val) +#define READ_MEM8(addr) (*(volatile unsigned char *) (addr)) + +#endif + +//config options +#define PRINTF printk +#define COLORIZE +#define PRINT_LINENUM +#define PRINT_FILENAME +#define PRINT_DEBUG + + +//use color +#ifdef COLORIZE + #define COLOR "1;32m" + #define COLOR_S "\033[" COLOR + #define COLOR_E "\033[0m" +#else + #define COLOR + #define COLOR_S + #define COLOR_E +#endif + +//print debug line +#ifdef PRINT_LINENUM + #define PRINT_LINE_F "LINE:%d " + #define PRINT_LINE_D __LINE__ +#else + #define PRINT_LINE_F "" + #define PRINT_LINE_D "" +#endif + +//print +#ifdef PRINT_FILENAME + #define PRINT_FILE_F "FILE:%s " + #define PRINT_FILE_D __FILE__ +#else + #define PRINT_FILE_F "" + #define PRINT_FILE_D "" +#endif + +//print debug string +#ifdef PRINT_DEBUG + #define PRINT_DEBUG_F "Debug: " +#else + #define PRINT_DEBUG_F "" +#endif + +#define PRINT( format, args ... ) PRINTF( COLOR_S PRINT_DEBUG_F \ + PRINT_FILE_F PRINT_LINE_F format COLOR_E, PRINT_FILE_D, \ + PRINT_LINE_D, ##args); + +#endif diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/setup.c b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/setup.c index edb6d830b..dddde7756 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/setup.c +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196c/setup.c @@ -28,10 +28,11 @@ #include "bspchip.h" extern int bsp_swcore_init(unsigned int version); +extern void __init rtl819x_add_device_usb(void); static void prom_putchar(char c) { -#define UART0_BASE 0xB8002000 + #define UART0_THR (UART0_BASE + 0x000) #define UART0_FCR (UART0_BASE + 0x008) #define UART0_LSR (UART0_BASE + 0x014) @@ -161,3 +162,5 @@ void __init bsp_setup(void) } #endif } + +pure_initcall(rtl819x_add_device_usb); diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/Makefile b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/Makefile index d32d4c5d5..9d8a06afd 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/Makefile +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/Makefile @@ -1,26 +1,17 @@ -# Realtek Semiconductor Corp. -# -# Tony Wu (tonywu@realtek.com) -# Oct. 18, 2008 -# +include $(TOPDIR)/.config -# -# RTL8198 -# -include $(DIR_LINUX)/.config - -core-y += arch/rlx/bsp/ cflags-y += -Iinclude/asm-rlx -Iarch/rlx/bsp/ +#load-y += 0xffffffff80000000 load-y += 0x80000000 extra-y += vmlinux.lds -obj-y := prom.o setup.o irq.o timer.o serial.o +obj-y := irq.o prom.o serial.o setup.o timer.o dev_usb.o obj-$(CONFIG_PCI) += pci.o EXTRA_AFLAGS := $(CFLAGS) -EXTRA_CFLAGS += -I$(DIR_LINUX)/drivers/net/rtl819x/AsicDriver -EXTRA_CFLAGS += -I$(DIR_LINUX)/drivers/net/rtl819x/common +EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/rtl819x/AsicDriver +EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/rtl819x/common ifdef CONFIG_RTL_819X_SWCORE EXTRA_CFLAGS += -DCONFIG_RTL_819X_SWCORE endif diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/bspchip.h b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/bspchip.h index 1bddb2a7d..5651dcbc9 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/bspchip.h +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/bspchip.h @@ -13,6 +13,8 @@ #ifndef _BSPCHIP_H_ #define _BSPCHIP_H_ +#include "rlxhack.h" + #include <linux/autoconf.h> /* diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/rlxhack.h b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/rlxhack.h new file mode 100644 index 000000000..450b3bb9c --- /dev/null +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/rlxhack.h @@ -0,0 +1,70 @@ +#ifndef __RLXHACK_H +#define __RLXHACK_H + +/* + * Register access macro + */ +#ifndef REG32 +#define REG32(reg) (*(volatile unsigned int *)((unsigned int)reg)) +#define REG16(reg) (*(volatile unsigned short *)((unsigned int)reg)) +#define REG08(reg) (*(volatile unsigned char *)((unsigned int)reg)) +#define REG8(reg) (*(volatile unsigned char *)((unsigned int)reg)) + +#define WRITE_MEM32(addr, val) (*(volatile unsigned int *) (addr)) = (val) +#define READ_MEM32(addr) (*(volatile unsigned int *) (addr)) +#define WRITE_MEM16(addr, val) (*(volatile unsigned short *) (addr)) = (val) +#define READ_MEM16(addr) (*(volatile unsigned short *) (addr)) +#define WRITE_MEM8(addr, val) (*(volatile unsigned char *) (addr)) = (val) +#define READ_MEM8(addr) (*(volatile unsigned char *) (addr)) + +#endif + +//config options +#define PRINTF printk +#define COLORIZE +#define PRINT_LINENUM +#define PRINT_FILENAME +#define PRINT_DEBUG + + +//use color +#ifdef COLORIZE + #define COLOR "1;32m" + #define COLOR_S "\033[" COLOR + #define COLOR_E "\033[0m" +#else + #define COLOR + #define COLOR_S + #define COLOR_E +#endif + +//print debug line +#ifdef PRINT_LINENUM + #define PRINT_LINE_F "LINE:%d " + #define PRINT_LINE_D __LINE__ +#else + #define PRINT_LINE_F "" + #define PRINT_LINE_D "" +#endif + +//print +#ifdef PRINT_FILENAME + #define PRINT_FILE_F "FILE:%s " + #define PRINT_FILE_D __FILE__ +#else + #define PRINT_FILE_F "" + #define PRINT_FILE_D "" +#endif + +//print debug string +#ifdef PRINT_DEBUG + #define PRINT_DEBUG_F "Debug: " +#else + #define PRINT_DEBUG_F "" +#endif + +#define PRINT( format, args ... ) PRINTF( COLOR_S PRINT_DEBUG_F \ + PRINT_FILE_F PRINT_LINE_F format COLOR_E, PRINT_FILE_D, \ + PRINT_LINE_D, ##args); + +#endif diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/setup.c b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/setup.c index 3544144a0..ec52ae2ad 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/setup.c +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl8196e/setup.c @@ -28,6 +28,7 @@ #include "bspchip.h" extern int bsp_swcore_init(unsigned int version); +extern void __init rtl819x_add_device_usb(void); static void prom_putchar(char c) { @@ -173,3 +174,5 @@ void __init bsp_setup(void) } #endif } + +pure_initcall(rtl819x_add_device_usb); diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/Makefile b/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/Makefile index d32d4c5d5..04c487630 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/Makefile +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/Makefile @@ -1,26 +1,18 @@ -# Realtek Semiconductor Corp. -# -# Tony Wu (tonywu@realtek.com) -# Oct. 18, 2008 -# +include $(TOPDIR)/.config -# -# RTL8198 -# -include $(DIR_LINUX)/.config -core-y += arch/rlx/bsp/ cflags-y += -Iinclude/asm-rlx -Iarch/rlx/bsp/ +#load-y += 0xffffffff80000000 load-y += 0x80000000 extra-y += vmlinux.lds -obj-y := prom.o setup.o irq.o timer.o serial.o +obj-y := irq.o prom.o serial.o setup.o timer.o dev_usb.o obj-$(CONFIG_PCI) += pci.o EXTRA_AFLAGS := $(CFLAGS) -EXTRA_CFLAGS += -I$(DIR_LINUX)/drivers/net/rtl819x/AsicDriver -EXTRA_CFLAGS += -I$(DIR_LINUX)/drivers/net/rtl819x/common +EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/rtl819x/AsicDriver +EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/rtl819x/common ifdef CONFIG_RTL_819X_SWCORE EXTRA_CFLAGS += -DCONFIG_RTL_819X_SWCORE endif diff --git a/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/setup.c b/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/setup.c index c6f147ad5..932e9aa2b 100644 --- a/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/setup.c +++ b/target/linux/realtek/files/arch/rlx/bsp_rtl819xD/setup.c @@ -185,3 +185,5 @@ void __init bsp_setup(void) } #endif } + +pure_initcall(rtl819x_add_device_usb); |