mirror of https://github.com/hak5/openwrt-owl.git
etrax: R.I.P.
It is broken and it is not maintained by anyone since long time. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34768owl
parent
b86e82e5cc
commit
1080f68b2b
|
@ -1,33 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
ARCH:=cris
|
||||
BOARD:=etrax
|
||||
MAINTAINER:=Claudio Mignanti <c.mignanti@gmail.com>
|
||||
BOARDNAME:=Axis ETRAX 100LX
|
||||
FEATURES:=squashfs jffs2 usb broken
|
||||
LINUX_VERSION:=2.6.32.33
|
||||
DEVICE_TYPE=
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
KERNELNAME:="zImage"
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for the FOXBOARD made by acmesystems.it
|
||||
endef
|
||||
|
||||
define Kernel/Prepare
|
||||
$(call Kernel/Prepare/Default)
|
||||
mkdir -p $(LINUX_DIR)/include/asm-cris
|
||||
$(CP) $(LINUX_DIR)/arch/cris/include/asm/*.h $(LINUX_DIR)/include/asm-cris
|
||||
mkdir -p $(LINUX_DIR)/include/asm-cris/arch
|
||||
$(CP) $(LINUX_DIR)/arch/cris/include/arch-v10/arch/*.h $(LINUX_DIR)/include/asm-cris/arch
|
||||
endef
|
||||
|
||||
$(eval $(call BuildTarget))
|
|
@ -1,6 +0,0 @@
|
|||
config defaults
|
||||
option syn_flood 1
|
||||
option input ACCEPT
|
||||
option output ACCEPT
|
||||
option forward REJECT
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
# Copyright (C) 2009 OpenWrt.org
|
||||
|
||||
config interface loopback
|
||||
option ifname lo
|
||||
option proto static
|
||||
option ipaddr 127.0.0.1
|
||||
option netmask 255.0.0.0
|
||||
|
||||
config interface lan
|
||||
option ifname eth0
|
||||
option type none
|
||||
option proto static
|
||||
option ipaddr 192.168.1.1
|
||||
option netmask 255.255.255.0
|
||||
# option macaddr 00:40:8c:cd:xx:xx
|
||||
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
CONFIG_BITREVERSE=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BOUNCE=y
|
||||
# CONFIG_BRIDGE is not set
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_CFG80211_DEFAULT_PS_VALUE=0
|
||||
CONFIG_CRIS=y
|
||||
# CONFIG_CRIS_MACH_ARTPEC3 is not set
|
||||
CONFIG_DECOMPRESS_LZMA=y
|
||||
# CONFIG_ETRAX100LX is not set
|
||||
CONFIG_ETRAX100LX_V2=y
|
||||
# CONFIG_ETRAXFS is not set
|
||||
CONFIG_ETRAX_ARCH_V10=y
|
||||
# CONFIG_ETRAX_ARCH_V32 is not set
|
||||
CONFIG_ETRAX_AXISFLASHMAP=y
|
||||
CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock1 rootfstype=jffs2 noinitrd console=ttyS0,115200"
|
||||
# CONFIG_ETRAX_CSP0_LEDS is not set
|
||||
# CONFIG_ETRAX_DEBUG_PORT0 is not set
|
||||
# CONFIG_ETRAX_DEBUG_PORT1 is not set
|
||||
# CONFIG_ETRAX_DEBUG_PORT2 is not set
|
||||
# CONFIG_ETRAX_DEBUG_PORT3 is not set
|
||||
CONFIG_ETRAX_DEBUG_PORT_NULL=y
|
||||
CONFIG_ETRAX_DEF_R_BUS_CONFIG=0x4
|
||||
CONFIG_ETRAX_DEF_R_PORT_PA_DATA=0xf0
|
||||
CONFIG_ETRAX_DEF_R_PORT_PA_DIR=0x1c
|
||||
CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=0x00
|
||||
CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0x03
|
||||
CONFIG_ETRAX_DEF_R_PORT_PB_DIR=0xce
|
||||
CONFIG_ETRAX_DEF_R_SDRAM_CONFIG=0x09603737
|
||||
CONFIG_ETRAX_DEF_R_SDRAM_TIMING=0x80008002
|
||||
CONFIG_ETRAX_DEF_R_WAITSTATES=0x95f8
|
||||
CONFIG_ETRAX_DRAM_SIZE=32
|
||||
CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
|
||||
CONFIG_ETRAX_ETHERNET=y
|
||||
CONFIG_ETRAX_FAST_TIMER=y
|
||||
CONFIG_ETRAX_FLASH1_SIZE=0
|
||||
CONFIG_ETRAX_FLASH_BUSWIDTH=2
|
||||
CONFIG_ETRAX_GPIO=y
|
||||
# CONFIG_ETRAX_I2C is not set
|
||||
# CONFIG_ETRAX_I2C_GVC is not set
|
||||
# CONFIG_ETRAX_KMALLOCED_MODULES is not set
|
||||
CONFIG_ETRAX_LED1G=2
|
||||
CONFIG_ETRAX_LED1R=2
|
||||
CONFIG_ETRAX_LED2G=3
|
||||
CONFIG_ETRAX_LED2R=3
|
||||
CONFIG_ETRAX_LED3G=2
|
||||
CONFIG_ETRAX_LED3R=2
|
||||
CONFIG_ETRAX_NANDFLASH_BUSWIDTH=1
|
||||
CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
|
||||
# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
|
||||
# CONFIG_ETRAX_NO_LEDS is not set
|
||||
CONFIG_ETRAX_PA_BUTTON_BITMASK=02
|
||||
CONFIG_ETRAX_PA_CHANGEABLE_BITS=0xFF
|
||||
CONFIG_ETRAX_PA_CHANGEABLE_DIR=0xFF
|
||||
CONFIG_ETRAX_PA_LEDS=y
|
||||
CONFIG_ETRAX_PB_CHANGEABLE_BITS=0xFF
|
||||
CONFIG_ETRAX_PB_CHANGEABLE_DIR=0xFF
|
||||
# CONFIG_ETRAX_PB_LEDS is not set
|
||||
CONFIG_ETRAX_PTABLE_SECTOR=0
|
||||
CONFIG_ETRAX_RESCUE_SER0=y
|
||||
# CONFIG_ETRAX_RESCUE_SER1 is not set
|
||||
# CONFIG_ETRAX_RESCUE_SER2 is not set
|
||||
# CONFIG_ETRAX_RESCUE_SER3 is not set
|
||||
# CONFIG_ETRAX_RS485 is not set
|
||||
CONFIG_ETRAX_SDRAM=y
|
||||
CONFIG_ETRAX_SER0_CD_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER0_CD_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER0_DSR_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER0_DTR_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER0_DTR_ON_PB_BIT=-1
|
||||
# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_MIXED is not set
|
||||
CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE=y
|
||||
# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PA is not set
|
||||
# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
|
||||
CONFIG_ETRAX_SER0_RI_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER0_RI_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER2_CD_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER2_CD_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER2_DSR_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER2_DSR_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER2_DTR_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER2_DTR_ON_PB_BIT=-1
|
||||
# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_MIXED is not set
|
||||
CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE=y
|
||||
# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PA is not set
|
||||
# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PB is not set
|
||||
CONFIG_ETRAX_SER2_RI_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER2_RI_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER3_CD_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER3_CD_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER3_DSR_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER3_DSR_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SER3_DTR_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER3_DTR_ON_PB_BIT=-1
|
||||
# CONFIG_ETRAX_SER3_DTR_RI_DSR_CD_MIXED is not set
|
||||
CONFIG_ETRAX_SER3_DTR_RI_DSR_CD_ON_NONE=y
|
||||
# CONFIG_ETRAX_SER3_DTR_RI_DSR_CD_ON_PA is not set
|
||||
# CONFIG_ETRAX_SER3_DTR_RI_DSR_CD_ON_PB is not set
|
||||
CONFIG_ETRAX_SER3_RI_ON_PA_BIT=-1
|
||||
CONFIG_ETRAX_SER3_RI_ON_PB_BIT=-1
|
||||
CONFIG_ETRAX_SERIAL=y
|
||||
# CONFIG_ETRAX_SERIAL_FAST_TIMER is not set
|
||||
# CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is not set
|
||||
CONFIG_ETRAX_SERIAL_PORT0=y
|
||||
# CONFIG_ETRAX_SERIAL_PORT0_DMA0_OUT is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT0_DMA1_IN is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN is not set
|
||||
CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN=y
|
||||
CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT=y
|
||||
# CONFIG_ETRAX_SERIAL_PORT1 is not set
|
||||
CONFIG_ETRAX_SERIAL_PORT2=y
|
||||
CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT=y
|
||||
CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN=y
|
||||
# CONFIG_ETRAX_SERIAL_PORT2_DMA6_OUT is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT2_DMA7_IN is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT is not set
|
||||
CONFIG_ETRAX_SERIAL_PORT3=y
|
||||
# CONFIG_ETRAX_SERIAL_PORT3_DMA2_OUT is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT3_DMA3_IN is not set
|
||||
CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT=y
|
||||
CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN=y
|
||||
# CONFIG_ETRAX_SERIAL_PORT3_DMA8_OUT is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT3_DMA9_IN is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_IN is not set
|
||||
# CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_OUT is not set
|
||||
CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=5
|
||||
# CONFIG_ETRAX_SOFT_SHUTDOWN is not set
|
||||
# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set
|
||||
CONFIG_ETRAX_USB_HOST=y
|
||||
CONFIG_ETRAX_USB_HOST_PORT1=y
|
||||
CONFIG_ETRAX_USB_HOST_PORT2=y
|
||||
# CONFIG_ETRAX_VCS_SIM is not set
|
||||
# CONFIG_ETRAX_WATCHDOG is not set
|
||||
CONFIG_FORCE_MAX_ZONEORDER=6
|
||||
# CONFIG_FSNOTIFY is not set
|
||||
CONFIG_GENERIC_FIND_LAST_BIT=y
|
||||
CONFIG_GENERIC_FIND_NEXT_BIT=y
|
||||
CONFIG_GENERIC_IOMAP=y
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_HAMRADIO is not set
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
|
||||
CONFIG_HAVE_IDE=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_MTDRAM_ABS_POS=0
|
||||
CONFIG_MTDRAM_ERASE_SIZE=128
|
||||
CONFIG_MTDRAM_TOTAL_SIZE=0
|
||||
# CONFIG_MTD_CFI_INTELEXT is not set
|
||||
CONFIG_MTD_CONCAT=y
|
||||
CONFIG_MTD_MTDRAM=y
|
||||
# CONFIG_NETDEV_1000 is not set
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
CONFIG_NO_IOPORT=y
|
||||
# CONFIG_OOM_REBOOT is not set
|
||||
CONFIG_PAGEFLAGS_EXTENDED=y
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_SCSI_DMA is not set
|
||||
# CONFIG_SERIAL_8250 is not set
|
||||
# CONFIG_SVINTO_SIM is not set
|
||||
# CONFIG_SYSTEM_PROFILER is not set
|
||||
# CONFIG_TREE_PREEMPT_RCU is not set
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_UID16=y
|
||||
CONFIG_USB=y
|
||||
# CONFIG_USB_ARCH_HAS_EHCI is not set
|
||||
# CONFIG_USB_ARCH_HAS_HCD is not set
|
||||
# CONFIG_USB_ARCH_HAS_OHCI is not set
|
||||
CONFIG_USB_SUPPORT=y
|
|
@ -1,49 +0,0 @@
|
|||
#ifndef _LINUX_ETRAXI2C_H
|
||||
#define _LINUX_ETRAXI2C_H
|
||||
|
||||
/* etraxi2c _IOC_TYPE, bits 8 to 15 in ioctl cmd */
|
||||
|
||||
#define ETRAXI2C_IOCTYPE 44
|
||||
|
||||
/* supported ioctl _IOC_NR's */
|
||||
|
||||
/* in write operations, the argument contains both i2c
|
||||
* slave, register and value.
|
||||
*/
|
||||
|
||||
#define I2C_WRITEARG(slave, reg, value) (((slave) << 16) | ((reg) << 8) | (value))
|
||||
#define I2C_READARG(slave, reg) (((slave) << 16) | ((reg) << 8))
|
||||
|
||||
#define I2C_ARGSLAVE(arg) ((arg) >> 16)
|
||||
#define I2C_ARGREG(arg) (((arg) >> 8) & 0xff)
|
||||
#define I2C_ARGVALUE(arg) ((arg) & 0xff)
|
||||
|
||||
#define I2C_WRITEREG 0x1 /* write to an I2C register */
|
||||
#define I2C_READREG 0x2 /* read from an I2C register */
|
||||
|
||||
/*
|
||||
EXAMPLE usage:
|
||||
|
||||
i2c_arg = I2C_WRITEARG(STA013_WRITE_ADDR, reg, val);
|
||||
ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_WRITEREG), i2c_arg);
|
||||
|
||||
i2c_arg = I2C_READARG(STA013_READ_ADDR, reg);
|
||||
val = ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_READREG), i2c_arg);
|
||||
|
||||
*/
|
||||
|
||||
/* Extended part */
|
||||
#define I2C_READ 0x4 /* reads from I2C device */
|
||||
#define I2C_WRITE 0x3 /* writes to I2C device */
|
||||
#define I2C_WRITEREAD 0x5 /* writes to I2C device where to start reading */
|
||||
|
||||
typedef struct _I2C_DATA
|
||||
{
|
||||
unsigned char slave; /* I2C address (8-bit representation) of slave device */
|
||||
unsigned char wbuf[256]; /* Write buffer (length = 256 bytes) */
|
||||
unsigned int wlen; /* Number of bytes to write from wbuf[] */
|
||||
unsigned char rbuf[256]; /* Read buffer (length = 256 bytes) */
|
||||
unsigned int rlen; /* Number of bytes to read into rbuf[] */
|
||||
} I2C_DATA;
|
||||
|
||||
#endif
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef _I2C_ERRNO_H
|
||||
#define _I2C_ERRNO_H
|
||||
|
||||
#define EI2CNOERRORS 0 /* All fine */
|
||||
#define EI2CBUSNFREE 1 /* I2C bus not free */
|
||||
#define EI2CWADDRESS 2 /* Address write failed */
|
||||
#define EI2CRADDRESS 3 /* Address read failed */
|
||||
#define EI2CSENDDATA 4 /* Sending data failed */
|
||||
#define EI2CRECVDATA 5 /* Receiving data failed */
|
||||
#define EI2CSTRTCOND 6 /* Start condition failed */
|
||||
#define EI2CRSTACOND 7 /* Repeated start condition failed */
|
||||
#define EI2CSTOPCOND 8 /* Stop condition failed */
|
||||
#define EI2CNOSNDBYT 9 /* Number of send bytes is 0, while there's a send buffer defined */
|
||||
#define EI2CNOSNDBUF 10 /* No send buffer defined, while number of send bytes is not 0 */
|
||||
#define EI2CNORCVBYT 11 /* Number of receive bytes is 0, while there's a receive buffer defined */
|
||||
#define EI2CNORCVBUF 12 /* No receive buffer defined, while number of receive bytes is not 0 */
|
||||
#define EI2CNOACKNLD 13 /* No acknowledge received from slave */
|
||||
#define EI2CNOMNUMBR 14 /* No MAJOR number received from kernel while registering the device */
|
||||
|
||||
#endif /* _I2C_ERRNO_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,30 +0,0 @@
|
|||
#ifndef _I2C_H
|
||||
#define _I2C_H
|
||||
|
||||
int i2c_init(void);
|
||||
|
||||
/* High level I2C actions */
|
||||
int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
|
||||
unsigned char i2c_readreg(unsigned char theSlave, unsigned char theReg);
|
||||
|
||||
/* Low level I2C */
|
||||
int i2c_start(void);
|
||||
int i2c_stop(void);
|
||||
int i2c_outbyte(unsigned char x);
|
||||
unsigned char i2c_inbyte(void);
|
||||
int i2c_getack(void);
|
||||
void i2c_sendack(void);
|
||||
void i2c_sendnack(void);
|
||||
|
||||
/**GVC**/
|
||||
/* New low level I2C functions */
|
||||
int i2c_read( unsigned char slave, unsigned char* rbuf, unsigned char rlen );
|
||||
int i2c_write( unsigned char slave, unsigned char* wbuf, unsigned char wlen );
|
||||
int i2c_writeread( unsigned char slave
|
||||
, unsigned char* wbuf
|
||||
, unsigned char wlen
|
||||
, unsigned char* rbuf
|
||||
, unsigned char rlen
|
||||
);
|
||||
/**END GVC**/
|
||||
#endif /* _I2C_H */
|
|
@ -1,142 +0,0 @@
|
|||
|
||||
/* macros for debug output */
|
||||
|
||||
#define hcd_dbg(hcd, fmt, args...) \
|
||||
dev_info(hcd->self.controller, fmt, ## args)
|
||||
#define hcd_err(hcd, fmt, args...) \
|
||||
dev_err(hcd->self.controller, fmt, ## args)
|
||||
#define hcd_info(hcd, fmt, args...) \
|
||||
dev_info(hcd->self.controller, fmt, ## args)
|
||||
#define hcd_warn(hcd, fmt, args...) \
|
||||
dev_warn(hcd->self.controller, fmt, ## args)
|
||||
|
||||
/*
|
||||
#define devdrv_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "usb_devdrv dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define devdrv_dbg(fmt, args...) {}
|
||||
|
||||
#define devdrv_err(fmt, args...) \
|
||||
printk(KERN_ERR "usb_devdrv error: ");printk(fmt, ## args)
|
||||
#define devdrv_info(fmt, args...) \
|
||||
printk(KERN_INFO "usb_devdrv: ");printk(fmt, ## args)
|
||||
|
||||
#define irq_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_irq dbg: ");printk(fmt, ## args)
|
||||
#define irq_err(fmt, args...) \
|
||||
printk(KERN_ERR "crisv10_irq error: ");printk(fmt, ## args)
|
||||
#define irq_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_irq warn: ");printk(fmt, ## args)
|
||||
#define irq_info(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_hcd: ");printk(fmt, ## args)
|
||||
|
||||
/*
|
||||
#define rh_dbg(fmt, args...) \
|
||||
printk(KERN_DEBUG "crisv10_rh dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define rh_dbg(fmt, args...) {}
|
||||
|
||||
#define rh_err(fmt, args...) \
|
||||
printk(KERN_ERR "crisv10_rh error: ");printk(fmt, ## args)
|
||||
#define rh_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_rh warning: ");printk(fmt, ## args)
|
||||
#define rh_info(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_rh: ");printk(fmt, ## args)
|
||||
|
||||
/*
|
||||
#define tc_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_tc dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define tc_dbg(fmt, args...) {while(0){}}
|
||||
|
||||
#define tc_err(fmt, args...) \
|
||||
printk(KERN_ERR "crisv10_tc error: ");printk(fmt, ## args)
|
||||
/*
|
||||
#define tc_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_tc warning: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define tc_warn(fmt, args...) {while(0){}}
|
||||
|
||||
#define tc_info(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_tc: ");printk(fmt, ## args)
|
||||
|
||||
|
||||
/* Debug print-outs for various traffic types */
|
||||
|
||||
#define intr_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_intr warning: ");printk(fmt, ## args)
|
||||
/*
|
||||
#define intr_dbg(fmt, args...) \
|
||||
printk(KERN_DEBUG "crisv10_intr dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define intr_dbg(fmt, args...) {while(0){}}
|
||||
|
||||
|
||||
#define isoc_err(fmt, args...) \
|
||||
printk(KERN_ERR "crisv10_isoc error: ");printk(fmt, ## args)
|
||||
/*
|
||||
#define isoc_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_isoc warning: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define isoc_warn(fmt, args...) {while(0){}}
|
||||
|
||||
/*
|
||||
#define isoc_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_isoc dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define isoc_dbg(fmt, args...) {while(0){}}
|
||||
|
||||
/*
|
||||
#define timer_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_timer warning: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define timer_warn(fmt, args...) {while(0){}}
|
||||
|
||||
/*
|
||||
#define timer_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_timer dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define timer_dbg(fmt, args...) {while(0){}}
|
||||
|
||||
|
||||
/* Debug printouts for events related to late finishing of URBs */
|
||||
/*
|
||||
#define late_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_late dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define late_dbg(fmt, args...) {while(0){}}
|
||||
|
||||
#define late_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_late warning: ");printk(fmt, ## args)
|
||||
/*
|
||||
#define errno_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_errno dbg: ");printk(fmt, ## args)
|
||||
*/
|
||||
#define errno_dbg(fmt, args...) {while(0){}}
|
||||
|
||||
|
||||
#define dma_dbg(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_dma dbg: ");printk(fmt, ## args)
|
||||
#define dma_err(fmt, args...) \
|
||||
printk(KERN_ERR "crisv10_dma error: ");printk(fmt, ## args)
|
||||
#define dma_warn(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_dma warning: ");printk(fmt, ## args)
|
||||
#define dma_info(fmt, args...) \
|
||||
printk(KERN_INFO "crisv10_dma: ");printk(fmt, ## args)
|
||||
|
||||
|
||||
|
||||
#define str_dir(pipe) \
|
||||
(usb_pipeout(pipe) ? "out" : "in")
|
||||
#define str_type(pipe) \
|
||||
({ \
|
||||
char *s = "?"; \
|
||||
switch (usb_pipetype(pipe)) { \
|
||||
case PIPE_ISOCHRONOUS: s = "iso"; break; \
|
||||
case PIPE_INTERRUPT: s = "intr"; break; \
|
||||
case PIPE_CONTROL: s = "ctrl"; break; \
|
||||
case PIPE_BULK: s = "bulk"; break; \
|
||||
}; \
|
||||
s; \
|
||||
})
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,334 +0,0 @@
|
|||
#ifndef __LINUX_ETRAX_USB_H
|
||||
#define __LINUX_ETRAX_USB_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
struct USB_IN_Desc {
|
||||
volatile __u16 sw_len;
|
||||
volatile __u16 command;
|
||||
volatile unsigned long next;
|
||||
volatile unsigned long buf;
|
||||
volatile __u16 hw_len;
|
||||
volatile __u16 status;
|
||||
};
|
||||
|
||||
struct USB_SB_Desc {
|
||||
volatile __u16 sw_len;
|
||||
volatile __u16 command;
|
||||
volatile unsigned long next;
|
||||
volatile unsigned long buf;
|
||||
};
|
||||
|
||||
struct USB_EP_Desc {
|
||||
volatile __u16 hw_len;
|
||||
volatile __u16 command;
|
||||
volatile unsigned long sub;
|
||||
volatile unsigned long next;
|
||||
};
|
||||
|
||||
|
||||
/* Root Hub port status struct */
|
||||
struct crisv10_rh {
|
||||
volatile __u16 wPortChange[2];
|
||||
volatile __u16 wPortStatusPrev[2];
|
||||
};
|
||||
|
||||
/* HCD description */
|
||||
struct crisv10_hcd {
|
||||
spinlock_t lock;
|
||||
__u8 num_ports;
|
||||
__u8 running;
|
||||
};
|
||||
|
||||
|
||||
/* Endpoint HC private data description */
|
||||
struct crisv10_ep_priv {
|
||||
int epid;
|
||||
};
|
||||
|
||||
/* Additional software state info for a USB Controller epid */
|
||||
struct etrax_epid {
|
||||
__u8 inuse; /* !0 = setup in Etrax and used for a endpoint */
|
||||
__u8 disabled; /* !0 = Temporarly disabled to avoid resubmission */
|
||||
__u8 type; /* Setup as: PIPE_BULK, PIPE_CONTROL ... */
|
||||
__u8 out_traffic; /* !0 = This epid is for out traffic */
|
||||
};
|
||||
|
||||
/* Struct to hold information of scheduled later URB completion */
|
||||
struct urb_later_data {
|
||||
struct delayed_work dws;
|
||||
struct usb_hcd *hcd;
|
||||
struct urb *urb;
|
||||
int urb_num;
|
||||
int status;
|
||||
};
|
||||
|
||||
|
||||
typedef enum {
|
||||
STARTED,
|
||||
NOT_STARTED,
|
||||
UNLINK,
|
||||
} crisv10_urb_state_t;
|
||||
|
||||
|
||||
struct crisv10_urb_priv {
|
||||
/* Sequence number for this URB. Every new submited URB gets this from
|
||||
a incrementing counter. Used when a URB is scheduled for later finish to
|
||||
be sure that the intended URB hasn't already been completed (device
|
||||
drivers has a tendency to reuse URBs once they are completed, causing us
|
||||
to not be able to single old ones out only based on the URB pointer.) */
|
||||
__u32 urb_num;
|
||||
|
||||
/* The first_sb field is used for freeing all SB descriptors belonging
|
||||
to an urb. The corresponding ep descriptor's sub pointer cannot be
|
||||
used for this since the DMA advances the sub pointer as it processes
|
||||
the sb list. */
|
||||
struct USB_SB_Desc *first_sb;
|
||||
|
||||
/* The last_sb field referes to the last SB descriptor that belongs to
|
||||
this urb. This is important to know so we can free the SB descriptors
|
||||
that ranges between first_sb and last_sb. */
|
||||
struct USB_SB_Desc *last_sb;
|
||||
|
||||
/* The rx_offset field is used in ctrl and bulk traffic to keep track
|
||||
of the offset in the urb's transfer_buffer where incoming data should be
|
||||
copied to. */
|
||||
__u32 rx_offset;
|
||||
|
||||
/* Counter used in isochronous transfers to keep track of the
|
||||
number of packets received/transmitted. */
|
||||
__u32 isoc_packet_counter;
|
||||
|
||||
/* Flag that marks if this Isoc Out URB has finished it's transfer. Used
|
||||
because several URBs can be finished before list is processed */
|
||||
__u8 isoc_out_done;
|
||||
|
||||
/* This field is used to pass information about the urb's current state
|
||||
between the various interrupt handlers (thus marked volatile). */
|
||||
volatile crisv10_urb_state_t urb_state;
|
||||
|
||||
/* In Ctrl transfers consist of (at least) 3 packets: SETUP, IN and ZOUT.
|
||||
When DMA8 sub-channel 2 has processed the SB list for this sequence we
|
||||
get a interrupt. We also get a interrupt for In transfers and which
|
||||
one of these interrupts that comes first depends of data size and device.
|
||||
To be sure that we have got both interrupts before we complete the URB
|
||||
we have these to flags that shows which part that has completed.
|
||||
We can then check when we get one of the interrupts that if the other has
|
||||
occured it's safe for us to complete the URB, otherwise we set appropriate
|
||||
flag and do the completion when we get the other interrupt. */
|
||||
volatile unsigned char ctrl_zout_done;
|
||||
volatile unsigned char ctrl_rx_done;
|
||||
|
||||
/* Connection between the submitted urb and ETRAX epid number */
|
||||
__u8 epid;
|
||||
|
||||
/* The rx_data_list field is used for periodic traffic, to hold
|
||||
received data for later processing in the the complete_urb functions,
|
||||
where the data us copied to the urb's transfer_buffer. Basically, we
|
||||
use this intermediate storage because we don't know when it's safe to
|
||||
reuse the transfer_buffer (FIXME?). */
|
||||
struct list_head rx_data_list;
|
||||
|
||||
|
||||
/* The interval time rounded up to closest 2^N */
|
||||
int interval;
|
||||
|
||||
/* Pool of EP descriptors needed if it's a INTR transfer.
|
||||
Amount of EPs in pool correspons to how many INTR that should
|
||||
be inserted in TxIntrEPList (max 128, defined by MAX_INTR_INTERVAL) */
|
||||
struct USB_EP_Desc* intr_ep_pool[128];
|
||||
|
||||
/* The mount of EPs allocated for this INTR URB */
|
||||
int intr_ep_pool_length;
|
||||
|
||||
/* Pointer to info struct if URB is scheduled to be finished later */
|
||||
struct urb_later_data* later_data;
|
||||
|
||||
/* Allocated bandwidth for isochronous and interrupt traffic */
|
||||
int bandwidth;
|
||||
};
|
||||
|
||||
|
||||
/* This struct is for passing data from the top half to the bottom half irq
|
||||
handlers */
|
||||
struct crisv10_irq_reg {
|
||||
struct usb_hcd* hcd;
|
||||
__u32 r_usb_epid_attn;
|
||||
__u8 r_usb_status;
|
||||
__u16 r_usb_rh_port_status_1;
|
||||
__u16 r_usb_rh_port_status_2;
|
||||
__u32 r_usb_irq_mask_read;
|
||||
__u32 r_usb_fm_number;
|
||||
struct work_struct usb_bh;
|
||||
};
|
||||
|
||||
|
||||
/* This struct is for passing data from the isoc top half to the isoc bottom
|
||||
half. */
|
||||
struct crisv10_isoc_complete_data {
|
||||
struct usb_hcd *hcd;
|
||||
struct urb *urb;
|
||||
struct work_struct usb_bh;
|
||||
};
|
||||
|
||||
/* Entry item for URB lists for each endpint */
|
||||
typedef struct urb_entry
|
||||
{
|
||||
struct urb *urb;
|
||||
struct list_head list;
|
||||
} urb_entry_t;
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Virtual Root HUB
|
||||
------------------------------------------------------------------------- */
|
||||
/* destination of request */
|
||||
#define RH_INTERFACE 0x01
|
||||
#define RH_ENDPOINT 0x02
|
||||
#define RH_OTHER 0x03
|
||||
|
||||
#define RH_CLASS 0x20
|
||||
#define RH_VENDOR 0x40
|
||||
|
||||
/* Requests: bRequest << 8 | bmRequestType */
|
||||
#define RH_GET_STATUS 0x0080
|
||||
#define RH_CLEAR_FEATURE 0x0100
|
||||
#define RH_SET_FEATURE 0x0300
|
||||
#define RH_SET_ADDRESS 0x0500
|
||||
#define RH_GET_DESCRIPTOR 0x0680
|
||||
#define RH_SET_DESCRIPTOR 0x0700
|
||||
#define RH_GET_CONFIGURATION 0x0880
|
||||
#define RH_SET_CONFIGURATION 0x0900
|
||||
#define RH_GET_STATE 0x0280
|
||||
#define RH_GET_INTERFACE 0x0A80
|
||||
#define RH_SET_INTERFACE 0x0B00
|
||||
#define RH_SYNC_FRAME 0x0C80
|
||||
/* Our Vendor Specific Request */
|
||||
#define RH_SET_EP 0x2000
|
||||
|
||||
|
||||
/* Hub port features */
|
||||
#define RH_PORT_CONNECTION 0x00
|
||||
#define RH_PORT_ENABLE 0x01
|
||||
#define RH_PORT_SUSPEND 0x02
|
||||
#define RH_PORT_OVER_CURRENT 0x03
|
||||
#define RH_PORT_RESET 0x04
|
||||
#define RH_PORT_POWER 0x08
|
||||
#define RH_PORT_LOW_SPEED 0x09
|
||||
#define RH_C_PORT_CONNECTION 0x10
|
||||
#define RH_C_PORT_ENABLE 0x11
|
||||
#define RH_C_PORT_SUSPEND 0x12
|
||||
#define RH_C_PORT_OVER_CURRENT 0x13
|
||||
#define RH_C_PORT_RESET 0x14
|
||||
|
||||
/* Hub features */
|
||||
#define RH_C_HUB_LOCAL_POWER 0x00
|
||||
#define RH_C_HUB_OVER_CURRENT 0x01
|
||||
|
||||
#define RH_DEVICE_REMOTE_WAKEUP 0x00
|
||||
#define RH_ENDPOINT_STALL 0x01
|
||||
|
||||
/* Our Vendor Specific feature */
|
||||
#define RH_REMOVE_EP 0x00
|
||||
|
||||
|
||||
#define RH_ACK 0x01
|
||||
#define RH_REQ_ERR -1
|
||||
#define RH_NACK 0x00
|
||||
|
||||
/* Field definitions for */
|
||||
|
||||
#define USB_IN_command__eol__BITNR 0 /* command macros */
|
||||
#define USB_IN_command__eol__WIDTH 1
|
||||
#define USB_IN_command__eol__no 0
|
||||
#define USB_IN_command__eol__yes 1
|
||||
|
||||
#define USB_IN_command__intr__BITNR 3
|
||||
#define USB_IN_command__intr__WIDTH 1
|
||||
#define USB_IN_command__intr__no 0
|
||||
#define USB_IN_command__intr__yes 1
|
||||
|
||||
#define USB_IN_status__eop__BITNR 1 /* status macros. */
|
||||
#define USB_IN_status__eop__WIDTH 1
|
||||
#define USB_IN_status__eop__no 0
|
||||
#define USB_IN_status__eop__yes 1
|
||||
|
||||
#define USB_IN_status__eot__BITNR 5
|
||||
#define USB_IN_status__eot__WIDTH 1
|
||||
#define USB_IN_status__eot__no 0
|
||||
#define USB_IN_status__eot__yes 1
|
||||
|
||||
#define USB_IN_status__error__BITNR 6
|
||||
#define USB_IN_status__error__WIDTH 1
|
||||
#define USB_IN_status__error__no 0
|
||||
#define USB_IN_status__error__yes 1
|
||||
|
||||
#define USB_IN_status__nodata__BITNR 7
|
||||
#define USB_IN_status__nodata__WIDTH 1
|
||||
#define USB_IN_status__nodata__no 0
|
||||
#define USB_IN_status__nodata__yes 1
|
||||
|
||||
#define USB_IN_status__epid__BITNR 8
|
||||
#define USB_IN_status__epid__WIDTH 5
|
||||
|
||||
#define USB_EP_command__eol__BITNR 0
|
||||
#define USB_EP_command__eol__WIDTH 1
|
||||
#define USB_EP_command__eol__no 0
|
||||
#define USB_EP_command__eol__yes 1
|
||||
|
||||
#define USB_EP_command__eof__BITNR 1
|
||||
#define USB_EP_command__eof__WIDTH 1
|
||||
#define USB_EP_command__eof__no 0
|
||||
#define USB_EP_command__eof__yes 1
|
||||
|
||||
#define USB_EP_command__intr__BITNR 3
|
||||
#define USB_EP_command__intr__WIDTH 1
|
||||
#define USB_EP_command__intr__no 0
|
||||
#define USB_EP_command__intr__yes 1
|
||||
|
||||
#define USB_EP_command__enable__BITNR 4
|
||||
#define USB_EP_command__enable__WIDTH 1
|
||||
#define USB_EP_command__enable__no 0
|
||||
#define USB_EP_command__enable__yes 1
|
||||
|
||||
#define USB_EP_command__hw_valid__BITNR 5
|
||||
#define USB_EP_command__hw_valid__WIDTH 1
|
||||
#define USB_EP_command__hw_valid__no 0
|
||||
#define USB_EP_command__hw_valid__yes 1
|
||||
|
||||
#define USB_EP_command__epid__BITNR 8
|
||||
#define USB_EP_command__epid__WIDTH 5
|
||||
|
||||
#define USB_SB_command__eol__BITNR 0 /* command macros. */
|
||||
#define USB_SB_command__eol__WIDTH 1
|
||||
#define USB_SB_command__eol__no 0
|
||||
#define USB_SB_command__eol__yes 1
|
||||
|
||||
#define USB_SB_command__eot__BITNR 1
|
||||
#define USB_SB_command__eot__WIDTH 1
|
||||
#define USB_SB_command__eot__no 0
|
||||
#define USB_SB_command__eot__yes 1
|
||||
|
||||
#define USB_SB_command__intr__BITNR 3
|
||||
#define USB_SB_command__intr__WIDTH 1
|
||||
#define USB_SB_command__intr__no 0
|
||||
#define USB_SB_command__intr__yes 1
|
||||
|
||||
#define USB_SB_command__tt__BITNR 4
|
||||
#define USB_SB_command__tt__WIDTH 2
|
||||
#define USB_SB_command__tt__zout 0
|
||||
#define USB_SB_command__tt__in 1
|
||||
#define USB_SB_command__tt__out 2
|
||||
#define USB_SB_command__tt__setup 3
|
||||
|
||||
|
||||
#define USB_SB_command__rem__BITNR 8
|
||||
#define USB_SB_command__rem__WIDTH 6
|
||||
|
||||
#define USB_SB_command__full__BITNR 6
|
||||
#define USB_SB_command__full__WIDTH 1
|
||||
#define USB_SB_command__full__no 0
|
||||
#define USB_SB_command__full__yes 1
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
config AXIS_FIMAGE
|
||||
bool "Build fimage"
|
||||
depends TARGET_etrax
|
||||
default y
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
define Image/BuildKernel
|
||||
cp $(KDIR)/vmlinuz $(BIN_DIR)/$(IMG_PREFIX)-zImage
|
||||
endef
|
||||
|
||||
define Image/Prepare
|
||||
cp $(LINUX_DIR)/arch/cris/boot/zImage $(KDIR)/vmlinuz
|
||||
$(MAKE) -C e100boot compile
|
||||
$(MAKE) -C mkfimage compile
|
||||
$(INSTALL_BIN) ./boot_linux $(BIN_DIR)
|
||||
endef
|
||||
|
||||
define Image/Build/generic
|
||||
mkfimage $(KDIR)/vmlinuz $(KDIR)/vmlinuz.tmp
|
||||
cat $(KDIR)/vmlinuz.tmp $(KDIR)/root.$(1) > $(KDIR)/fimage.$(1).tmp
|
||||
dd if=$(KDIR)/fimage.$(1).tmp of=$(KDIR)/fimage.$(1) bs=$(2) conv=sync
|
||||
cp $(KDIR)/fimage.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-fimage
|
||||
endef
|
||||
|
||||
define Image/Build/jffs2-64k
|
||||
$(call prepare_generic_jffs-64k,$(KDIR)/root.jff2-64k)
|
||||
$(call Image/Build/generic,$(1),4194304)
|
||||
endef
|
||||
|
||||
define Image/Build/squashfs
|
||||
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
||||
$(call Image/Build/generic,$(1),4194304)
|
||||
endef
|
||||
|
||||
define Image/Build
|
||||
$(call Image/Build/$(1),$(1))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildImage))
|
|
@ -1,511 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
#*****************************************************************************
|
||||
#!
|
||||
#! FILE NAME : boot_linux
|
||||
#!
|
||||
#! PARAMETERS : -b <bootimage> the name of the boot image to use
|
||||
#! -d <device> the interface to use, e.g., eth1
|
||||
#! (defaults is eth0)
|
||||
#! -f save it in flash memory at address 0x10000
|
||||
#! -F save it in flash memory at address 0
|
||||
#! -h show some help
|
||||
#! -i <image> name of the image to use (default is fimage)
|
||||
#! -o <offset> the offset in the flash where the flashing
|
||||
#! starts
|
||||
#! -O <offset> the offset in the image file where the
|
||||
#! flashing starts from
|
||||
#! -p print the resulting etrax100boot command
|
||||
#! instead of executing it
|
||||
#! -s <size> how much to flash (default is the size of
|
||||
#! the flash minus the offset specified using
|
||||
#! -o or -f)
|
||||
#! -S <size> the size of the flash
|
||||
#!
|
||||
#! All sizes and offsets above can be specified as decimal
|
||||
#! numbers, or as hexadecimal numbers by prefixing them with 0x.
|
||||
#! It is also possible to use the suffixes k and M to specify
|
||||
#! kilo (1024) or mega (1048576).
|
||||
#!
|
||||
#! DESCRIPTION: Extract the start of the image and any registers that should
|
||||
#! be set from the kimage or fimage file, and then boot it.
|
||||
#!
|
||||
#! FUNCTIONS : convert_size
|
||||
#! extract_hw_settings
|
||||
#! get_dword
|
||||
#! calculate_sdram_init
|
||||
#! sdram_command
|
||||
#! print_help
|
||||
#!
|
||||
#!----------------------------------------------------------------------------
|
||||
#! HISTORY
|
||||
#!
|
||||
#! $Log: boot_linux,v $
|
||||
#! Revision 1.16 2004/11/01 16:32:27 starvik
|
||||
#! Corrected help text to avoid confusion
|
||||
#!
|
||||
#! Revision 1.15 2003/01/29 11:48:57 pkj
|
||||
#! Calculate a flash size large enough for the given image if the
|
||||
#! -S option is not specified.
|
||||
#!
|
||||
#! Revision 1.14 2002/11/18 14:40:09 pkj
|
||||
#! Make use of the --loop option to etrax100boot when initialising
|
||||
#! SDRAM memories. This requires a lot fewer options to be passed
|
||||
#! to the boot loader.
|
||||
#!
|
||||
#! Revision 1.13 2002/08/15 16:29:02 pkj
|
||||
#! * The -S option now accepts the size in bytes (just like the -s option).
|
||||
#! For backwards compatibility it still assumes sizes of 16 and less to
|
||||
#! be specified in MB.
|
||||
#! * The suffixes k and M can now be used with all sizes and offsets to
|
||||
#! specify them in kilo or mega.
|
||||
#!
|
||||
#! Revision 1.12 2002/08/15 15:27:34 pkj
|
||||
#! Use $opts{'x'} instead of $opt_x.
|
||||
#!
|
||||
#! Revision 1.11 2002/07/04 17:06:39 pkj
|
||||
#! * No longer specifies a bootfile by default (not needed any longer).
|
||||
#! * Implemented option -b to specify a bootfile.
|
||||
#! * Removed references to option -l (it was never implemented).
|
||||
#!
|
||||
#! Revision 1.10 2002/06/04 11:50:23 starvik
|
||||
#! Check if mrs_data is specified in kernelconfig (necessary for MCM)
|
||||
#!
|
||||
#! Revision 1.9 2002/01/29 10:38:26 pkj
|
||||
#! Change illegal to invalid.
|
||||
#!
|
||||
#! Revision 1.8 2001/09/13 12:32:10 pkj
|
||||
#! * Added option -S to specify the size of the flash (in MB), as -s
|
||||
#! is used to specify how much to flash nowadays.
|
||||
#! * Made the default size of the flash depend on the size of the image
|
||||
#! file. If it is bigger than 0x200100 then the flash is assumed to
|
||||
#! be 4 MB, otherwise it is assumed to be 2 MB.
|
||||
#! * Added verification of various options.
|
||||
#!
|
||||
#! Revision 1.7 2001/09/13 10:25:11 pkj
|
||||
#! Minor clean-up.
|
||||
#!
|
||||
#! Revision 1.6 2001/06/29 10:05:16 pkj
|
||||
#! Corrected check for SDRAM.
|
||||
#!
|
||||
#! Revision 1.5 2001/06/29 09:11:55 pkj
|
||||
#! Synchronised boot_elinux and boot_linux.
|
||||
#!
|
||||
#!----------------------------------------------------------------------------
|
||||
#! (C) Copyright 2001, Axis Communications AB, LUND, SWEDEN
|
||||
#!****************************************************************************
|
||||
|
||||
#****************** INCLUDE FILES SECTION ************************************
|
||||
|
||||
use strict;
|
||||
|
||||
use Getopt::Std;
|
||||
use File::Basename;
|
||||
|
||||
#****************** VARIABLE DECLARATION SECTION *****************************
|
||||
|
||||
use vars qw($my_name %opts);
|
||||
use vars qw($text_start $cmd);
|
||||
use vars qw($image_name $image_size);
|
||||
use vars qw($offset $source_offset $flash_size $flashing_size);
|
||||
use vars qw($sdram_timing_address $sdram_config_address);
|
||||
use vars qw($sdram_precharge $sdram_nop $sdram_refresh $sdram_mrs);
|
||||
|
||||
#****************** CONSTANT SECTION *****************************************
|
||||
|
||||
# Register addresses
|
||||
$sdram_timing_address = "b0000008";
|
||||
$sdram_config_address = "b000000c";
|
||||
|
||||
# SDRAM commands
|
||||
$sdram_precharge = 3;
|
||||
$sdram_nop = 0;
|
||||
$sdram_refresh = 2;
|
||||
$sdram_mrs = 1;
|
||||
|
||||
#****************** MAIN PROGRAM SECTION *************************************
|
||||
|
||||
# The name of this program.
|
||||
$my_name = basename($0);
|
||||
|
||||
# Get options
|
||||
getopts('b:d:fFhi:o:O:ps:S:', \%opts);
|
||||
|
||||
&print_help if ($opts{'h'});
|
||||
|
||||
# Name and existance of the image
|
||||
$image_name = ($opts{'i'} ? $opts{'i'} : 'fimage');
|
||||
die "Could not find the image $image_name!\n" unless (-s $image_name);
|
||||
|
||||
if ($opts{'f'} || $opts{'F'})
|
||||
{
|
||||
$image_size = -s $image_name;
|
||||
|
||||
$offset = ($opts{'f'} ? 0x10000 : 0);
|
||||
|
||||
$offset = &convert_size($opts{'o'}) if (defined($opts{'o'}));
|
||||
|
||||
die("$my_name: Invalid destination offset\n") if ($offset !~ /^\d+$/);
|
||||
|
||||
my $base_name = basename($image_name);
|
||||
if ($base_name eq 'timage' || $base_name eq 'flash1.img')
|
||||
{
|
||||
$source_offset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$source_offset = $offset;
|
||||
}
|
||||
|
||||
$source_offset = &convert_size($opts{'O'}) if (defined($opts{'O'}));
|
||||
|
||||
die("$my_name: Invalid source offset\n") if ($source_offset !~ /^\d+$/);
|
||||
die("$my_name: Source offset > image size\n") if ($source_offset > $image_size);
|
||||
|
||||
if (defined($opts{'S'}))
|
||||
{
|
||||
# Backwards compatibility to allow specifying the flash size in MB
|
||||
# without using an M suffix
|
||||
$opts{'S'} .= 'M' if ($opts{'S'} =~ /^\d+$/ && $opts{'S'} <= 16);
|
||||
|
||||
$flash_size = &convert_size($opts{'S'});
|
||||
}
|
||||
else
|
||||
{
|
||||
# Calculate a flash size large enough for the image without the checksum
|
||||
# and HWID.
|
||||
$flash_size = ($image_size - $source_offset + $offset) & 0xFFFF0000;
|
||||
}
|
||||
|
||||
die("$my_name: Invalid flash size\n") if ($flash_size !~ /^\d+$/);
|
||||
die("$my_name: Destination offset > flash size\n") if ($offset > $flash_size);
|
||||
if (defined($opts{'s'}))
|
||||
{
|
||||
$flashing_size = &convert_size($opts{'s'});
|
||||
}
|
||||
else
|
||||
{
|
||||
$flashing_size = $flash_size - $offset;
|
||||
}
|
||||
|
||||
die("$my_name: Invalid size to flash\n") if ($flashing_size !~ /^\d+$/);
|
||||
|
||||
if ($flashing_size > $flash_size - $offset)
|
||||
{
|
||||
$flashing_size = $flash_size - $offset;
|
||||
printf("Warning: Flashing size limited to 0x%lx due to the offset (0x%lx) and flash size (0x%lx).\n", $flashing_size, $offset, $flash_size);
|
||||
}
|
||||
|
||||
if ($flashing_size > $image_size - $source_offset)
|
||||
{
|
||||
$flashing_size = $image_size - $source_offset;
|
||||
printf("Warning: Flashing size limited to 0x%lx due to the offset (0x%lx) and image size (0x%lx).\n", $flashing_size, $source_offset, $image_size);
|
||||
}
|
||||
}
|
||||
|
||||
# Create the command line to boot the image
|
||||
if (system('./etrax100boot --help > /dev/null') == 0)
|
||||
{
|
||||
$cmd = './etrax100boot';
|
||||
}
|
||||
elsif (system('svinto_boot --help > /dev/null') == 0)
|
||||
{
|
||||
$cmd = 'svinto_boot';
|
||||
}
|
||||
else
|
||||
{
|
||||
die("Cannot find e100boot program in your PATH!\n");
|
||||
}
|
||||
|
||||
$cmd .= " --device $opts{'d'}" if ($opts{'d'});
|
||||
|
||||
$cmd .= &extract_hw_settings;
|
||||
|
||||
$cmd .= " --bootfile $opts{'b'}" if ($opts{'b'});
|
||||
$cmd .= " --file $image_name $text_start";
|
||||
|
||||
if ($opts{'f'} || $opts{'F'})
|
||||
{
|
||||
$cmd .= sprintf(" --flash %lx %lx %lx --jump 0",
|
||||
hex($text_start) + $source_offset, $offset, $flashing_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
$cmd .= " --jump $text_start";
|
||||
}
|
||||
|
||||
if ($opts{'p'})
|
||||
{
|
||||
print "Command:\n$cmd\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
system($cmd);
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
#****************** FUNCTION DEFINITION SECTION ******************************
|
||||
|
||||
#*****************************************************************************
|
||||
##
|
||||
## FUNCTION NAME: convert_size
|
||||
##
|
||||
##****************************************************************************
|
||||
|
||||
sub convert_size
|
||||
{
|
||||
my($arg) = @_;
|
||||
my $size;
|
||||
|
||||
if ($arg =~ /^0x([\da-fA-F]+)([kM])?$/)
|
||||
{
|
||||
$size = hex($1);
|
||||
}
|
||||
elsif ($arg =~ /^(\d+)([kM])?$/)
|
||||
{
|
||||
$size = $1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!defined($2))
|
||||
{
|
||||
return $size;
|
||||
}
|
||||
elsif ($2 eq 'k')
|
||||
{
|
||||
return $size * 1024;
|
||||
}
|
||||
elsif ($2 eq 'M')
|
||||
{
|
||||
return $size * 1048576;
|
||||
}
|
||||
}
|
||||
|
||||
#*****************************************************************************
|
||||
##
|
||||
## FUNCTION NAME: extract_hw_settings
|
||||
##
|
||||
##****************************************************************************
|
||||
|
||||
sub extract_hw_settings
|
||||
{
|
||||
my $data;
|
||||
my $dbg_port;
|
||||
my $sdram_enabled;
|
||||
my $return_value = "";
|
||||
my $sdram_config;
|
||||
|
||||
# The hw information table has the following format
|
||||
#
|
||||
# "HW_PARAM_MAGIC"
|
||||
# text_start (dword)
|
||||
# serial debg port (dword)
|
||||
# sdram enabled (dword)
|
||||
# register address (dword)
|
||||
# register value (dword)
|
||||
# ...
|
||||
# 0
|
||||
|
||||
open(FILE, "$image_name") || die("Could not open '$image_name'");
|
||||
|
||||
while (<FILE>)
|
||||
{
|
||||
if (m/HW_PARAM_MAGIC/g)
|
||||
{
|
||||
# Seek to first byte after magic
|
||||
seek(FILE, -length($_) + pos($_), 1);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$text_start = &get_dword;
|
||||
$dbg_port = &get_dword;
|
||||
$sdram_enabled = int(&get_dword);
|
||||
|
||||
while (1)
|
||||
{
|
||||
my $register = &get_dword;
|
||||
my $value = &get_dword;
|
||||
|
||||
last if ($register eq "00000000");
|
||||
|
||||
if ($sdram_enabled)
|
||||
{
|
||||
if ($register eq $sdram_config_address)
|
||||
{
|
||||
$sdram_config = $value;
|
||||
}
|
||||
elsif ($register eq $sdram_timing_address)
|
||||
{
|
||||
$return_value .= &calculate_sdram_init($value, $sdram_config);
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
$return_value .= " --setreg $register $value";
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
|
||||
return $return_value;
|
||||
}
|
||||
|
||||
#*****************************************************************************
|
||||
##
|
||||
## FUNCTION NAME: get_dword
|
||||
##
|
||||
##****************************************************************************
|
||||
|
||||
sub get_dword
|
||||
{
|
||||
my $data;
|
||||
|
||||
read(FILE, $data, 4);
|
||||
return unpack("H8", pack("V", unpack("N", $data)));
|
||||
}
|
||||
|
||||
#*****************************************************************************
|
||||
##
|
||||
## FUNCTION NAME: calculate_sdram_init
|
||||
##
|
||||
##****************************************************************************
|
||||
|
||||
sub calculate_sdram_init
|
||||
{
|
||||
# Refer to ETRAX 100LX Designers Reference for a description of SDRAM
|
||||
# initialization
|
||||
my $sdram_init_val = hex($_[0]);
|
||||
my $sdram_config_val = hex($_[1]);
|
||||
my $bus_width = $sdram_config_val & 0x00800000;
|
||||
my $speed;
|
||||
my $cas_latency;
|
||||
my $mrs_data;
|
||||
my $temp;
|
||||
my $return_value;
|
||||
my $value;
|
||||
|
||||
$mrs_data = ($sdram_init_val & 0x00ff0000) >> 16;
|
||||
$sdram_init_val &= 0x8000ffff; # Make sure mrs data is 0
|
||||
$sdram_init_val |= 0x80000000; # Make sure sdram is enabled
|
||||
$speed = $sdram_init_val & 0x1000;
|
||||
$cas_latency = $sdram_init_val & 0x3;
|
||||
if ($speed) # 100 MHz
|
||||
{
|
||||
$cas_latency += 2;
|
||||
}
|
||||
else # 50 MHz
|
||||
{
|
||||
$cas_latency += 1;
|
||||
}
|
||||
|
||||
# Calculate value of mrs_data
|
||||
# CAS latency = 2 && bus_width = 32 => 0x40
|
||||
# CAS latency = 3 && bus_width = 32 => 0x60
|
||||
# CAS latency = 2 && bus_width = 16 => 0x20
|
||||
# CAS latency = 3 && bus_width = 16 => 0x30
|
||||
if ($mrs_data == 0)
|
||||
{
|
||||
if ($bus_width == 0) # 16 bits
|
||||
{
|
||||
$mrs_data = $cas_latency == 2 ? 0x20 : 0x30;
|
||||
}
|
||||
else # 32 bits
|
||||
{
|
||||
$mrs_data = $cas_latency == 2 ? 0x40 : 0x60;
|
||||
}
|
||||
}
|
||||
|
||||
$temp = $sdram_init_val | 0x0000c000; # Disable refresh
|
||||
$return_value .= &sdram_command($temp);
|
||||
$return_value .= " --pause 20000";
|
||||
|
||||
$return_value .= &sdram_command($temp, $sdram_precharge);
|
||||
$return_value .= &sdram_command($temp, $sdram_nop);
|
||||
|
||||
$return_value .= " --setreg +0 7";
|
||||
$return_value .= " --label label1";
|
||||
$return_value .= &sdram_command($temp, $sdram_refresh);
|
||||
$return_value .= &sdram_command($temp, $sdram_nop);
|
||||
$return_value .= " --loop +0 label1";
|
||||
|
||||
$return_value .= &sdram_command($temp, $sdram_mrs, $mrs_data);
|
||||
$return_value .= &sdram_command($temp, $sdram_nop);
|
||||
|
||||
$return_value .= &sdram_command($sdram_init_val);
|
||||
|
||||
return $return_value;
|
||||
}
|
||||
|
||||
#*****************************************************************************
|
||||
##
|
||||
## FUNCTION NAME: sdram_command
|
||||
##
|
||||
##****************************************************************************
|
||||
|
||||
sub sdram_command
|
||||
{
|
||||
my($temp, $value, $mrs_data) = @_;
|
||||
|
||||
$value ||= 0;
|
||||
if ($value == $sdram_mrs)
|
||||
{
|
||||
$value = sprintf("%lx", $temp | ($value << 9) | ($mrs_data << 16));
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = sprintf("%lx", $temp | ($value << 9));
|
||||
}
|
||||
|
||||
return " --setreg $sdram_timing_address $value";
|
||||
}
|
||||
|
||||
#*****************************************************************************
|
||||
##
|
||||
## FUNCTION NAME: print_help
|
||||
##
|
||||
##****************************************************************************
|
||||
|
||||
sub print_help
|
||||
{
|
||||
print "\nAXIS $my_name, ", '$Revision: 1.16 $ $Date: 2004/11/01 16:32:27 $ ', "\n";
|
||||
die <<EOT;
|
||||
Copyright (C) 2001-2002 Axis Communications AB
|
||||
|
||||
DESCRIPTION:
|
||||
This program is used to boot (and flash) a linux image to a box.
|
||||
It tries to extract the required ETRAX 100 settings from the image file.
|
||||
|
||||
SYNTAX:
|
||||
$my_name [options]
|
||||
|
||||
OPTIONS:
|
||||
-b <bootfile> : The boot image to use.
|
||||
-d <device> : The network interface to use, default is eth0.
|
||||
-f : Save the image in the flash memory starting at
|
||||
address 0x10000.
|
||||
-F : Save the image in the flash memory starting at
|
||||
address 0.
|
||||
-h : Print this help text.
|
||||
-i <image> : The path and name of the image to use, default
|
||||
is fimage.
|
||||
-o <offset> : The offset in the flash where the flashing starts.
|
||||
-O <offset> : The offset in the image file where the flashing
|
||||
starts from.
|
||||
-p : Print the resulting etrax100boot command instead
|
||||
of executing it.
|
||||
-s <size> : How much to flash (default is the size of the
|
||||
flash minus the offset specified using -o or -f).
|
||||
-S <size> : The size of the flash.
|
||||
|
||||
All sizes and offsets above can be specified as decimal numbers, or as
|
||||
hexadecimal numbers by prefixing them with 0x. It is also possible to use
|
||||
the suffixes k and M to specify kilo (1024) or mega (1048576).
|
||||
|
||||
EOT
|
||||
}
|
||||
|
||||
#****************** END OF FILE boot_linux ***********************************
|
|
@ -1,34 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=e100boot
|
||||
PKG_VERSION:=0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=e100boot.tar.bz2
|
||||
PKG_SOURCE_URL:=http://www.acmesystems.it/download/owrt \
|
||||
http://download.tuxfamily.org/crisos/repository/source/
|
||||
PKG_MD5SUM:=11fd53e7824dc550e4cffbc4cd114c3e
|
||||
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
CRLF_WORKAROUND=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Build/Compile
|
||||
make -C $(PKG_BUILD_DIR) STRIP=true
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/sbl/e100boot $(BIN_DIR)/etrax100boot
|
||||
endef
|
||||
|
||||
$(eval $(call Build/DefaultTargets))
|
|
@ -1,29 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mkfimage
|
||||
PKG_VERSION:=0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Build/Compile
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
cp -r ./src/* $(PKG_BUILD_DIR)
|
||||
make -C $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mkfimage $(STAGING_DIR_HOST)/bin/mkfimage
|
||||
endef
|
||||
|
||||
$(eval $(call Build/DefaultTargets))
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
all: mkfimage
|
||||
gcc mkfimage.c -o mkfimage
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv){
|
||||
unsigned char *buffer = malloc(64 * 1024);
|
||||
struct stat s;
|
||||
unsigned int size_vmlinux = 0, real_size_vmlinux = 0;
|
||||
const unsigned char *magic_str = "ACME_PART_MAGIC";
|
||||
unsigned int loop;
|
||||
unsigned char *magic;
|
||||
|
||||
if(argc != 3){
|
||||
printf("%s in out\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Generating image\n");
|
||||
|
||||
FILE *vmlinux = fopen(argv[1], "r");
|
||||
FILE *vmlinux_out = fopen(argv[2], "w");
|
||||
if((!vmlinux) || (!vmlinux_out)){
|
||||
printf("Error opening a file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
stat(argv[1], &s);
|
||||
size_vmlinux = s.st_size;
|
||||
real_size_vmlinux = (size_vmlinux & 0xffff0000) + 0x10000;
|
||||
|
||||
printf("vmlinux = 0x%.08X / 0x%.08X\n", size_vmlinux, real_size_vmlinux);
|
||||
|
||||
unsigned int t = fread(buffer, 1, 64 * 1024, vmlinux);
|
||||
for(loop = 0; loop < (64 * 1024) - sizeof(magic_str); loop++){
|
||||
if(buffer[loop] == magic_str[0]){
|
||||
if((magic = strstr(&buffer[loop], magic_str))){
|
||||
printf("Magic at 0x%.08X %p %p\n", magic - buffer, magic, buffer);
|
||||
printf("Found Magic %X%X%X%X\n",
|
||||
buffer[loop + strlen(magic_str)],
|
||||
buffer[loop + strlen(magic_str) + 2],
|
||||
buffer[loop + strlen(magic_str) + 1],
|
||||
buffer[loop + strlen(magic_str) + 3]);
|
||||
|
||||
buffer[loop + strlen(magic_str)] = real_size_vmlinux >> 24;
|
||||
buffer[loop + strlen(magic_str) + 2] = (real_size_vmlinux >> 16) & 0xff;
|
||||
buffer[loop + strlen(magic_str) + 1] = (real_size_vmlinux >> 8) & 0xff;
|
||||
buffer[loop + strlen(magic_str) + 3] = (real_size_vmlinux) & 0xff;
|
||||
|
||||
printf("Replaced with %.02X%.02X%.02X%.02X\n",
|
||||
buffer[loop + strlen(magic_str)],
|
||||
buffer[loop + strlen(magic_str) + 2],
|
||||
buffer[loop + strlen(magic_str) + 1],
|
||||
buffer[loop + strlen(magic_str) + 3]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fwrite(buffer, 1, 64 * 1024, vmlinux_out);
|
||||
real_size_vmlinux -= 64 * 1024;
|
||||
do {
|
||||
real_size_vmlinux -= 64 * 1024;
|
||||
memset(buffer, 0, 64 * 1024);
|
||||
fread(buffer, 1, 64 * 1024, vmlinux);
|
||||
fwrite(buffer, 1, 64 * 1024, vmlinux_out);
|
||||
} while (real_size_vmlinux);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
--- a/arch/cris/boot/compressed/Makefile
|
||||
+++ b/arch/cris/boot/compressed/Makefile
|
||||
@@ -18,7 +18,7 @@ ldflags-y += -T $(srctree)/$(src)/decomp
|
||||
OBJECTS-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o
|
||||
OBJECTS-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o
|
||||
OBJECTS= $(OBJECTS-y) $(obj)/misc.o
|
||||
-OBJCOPYFLAGS = -O binary --remove-section=.bss
|
||||
+#OBJCOPYFLAGS = -O binary --remove-section=.bss
|
||||
|
||||
quiet_cmd_image = BUILD $@
|
||||
cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
|
||||
--- a/arch/cris/boot/Makefile
|
||||
+++ b/arch/cris/boot/Makefile
|
||||
@@ -5,7 +5,7 @@
|
||||
objcopyflags-$(CONFIG_ETRAX_ARCH_V10) += -R .note -R .comment
|
||||
objcopyflags-$(CONFIG_ETRAX_ARCH_V32) += --remove-section=.bss
|
||||
|
||||
-OBJCOPYFLAGS = -O binary $(objcopyflags-y)
|
||||
+#OBJCOPYFLAGS = -O binary $(objcopyflags-y)
|
||||
|
||||
|
||||
subdir- := compressed rescue
|
||||
@@ -17,7 +17,7 @@ $(obj)/Image: vmlinux FORCE
|
||||
|
||||
$(obj)/compressed/vmlinux: $(obj)/Image FORCE
|
||||
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
||||
- $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
|
||||
+# $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
|
||||
|
||||
$(obj)/zImage: $(obj)/compressed/vmlinux
|
||||
@cp $< $@
|
||||
--- a/arch/cris/boot/rescue/Makefile
|
||||
+++ b/arch/cris/boot/rescue/Makefile
|
||||
@@ -14,7 +14,7 @@ arch-$(CONFIG_ETRAX_ARCH_V10) = v10
|
||||
arch-$(CONFIG_ETRAX_ARCH_V32) = v32
|
||||
|
||||
ldflags-y += -T $(srctree)/$(src)/rescue_$(arch-y).lds
|
||||
-OBJCOPYFLAGS = -O binary --remove-section=.bss
|
||||
+#OBJCOPYFLAGS = -O binary --remove-section=.bss
|
||||
obj-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o
|
||||
obj-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o
|
||||
OBJECTS := $(obj-y)
|
||||
--- a/arch/cris/Makefile
|
||||
+++ b/arch/cris/Makefile
|
||||
@@ -40,7 +40,7 @@ endif
|
||||
|
||||
LD = $(CROSS_COMPILE)ld -mcrislinux
|
||||
|
||||
-OBJCOPYFLAGS := -O binary -R .note -R .comment -S
|
||||
+OBJCOPYFLAGS := -O binary -R .bss -R .note -R .note.gnu.build-id -R .comment -S
|
||||
|
||||
KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
|
||||
KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
|
|
@ -1,88 +0,0 @@
|
|||
--- a/arch/cris/arch-v10/drivers/axisflashmap.c
|
||||
+++ b/arch/cris/arch-v10/drivers/axisflashmap.c
|
||||
@@ -113,7 +113,7 @@ static struct map_info map_cse1 = {
|
||||
|
||||
/* If no partition-table was found, we use this default-set. */
|
||||
#define MAX_PARTITIONS 7
|
||||
-#define NUM_DEFAULT_PARTITIONS 3
|
||||
+#define NUM_DEFAULT_PARTITIONS 2
|
||||
|
||||
/*
|
||||
* Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the
|
||||
@@ -122,19 +122,14 @@ static struct map_info map_cse1 = {
|
||||
*/
|
||||
static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
|
||||
{
|
||||
- .name = "boot firmware",
|
||||
- .size = CONFIG_ETRAX_PTABLE_SECTOR,
|
||||
- .offset = 0
|
||||
- },
|
||||
- {
|
||||
.name = "kernel",
|
||||
- .size = 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
|
||||
- .offset = CONFIG_ETRAX_PTABLE_SECTOR
|
||||
+ .size = 0x00,
|
||||
+ .offset = 0
|
||||
},
|
||||
{
|
||||
- .name = "filesystem",
|
||||
- .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
|
||||
- .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
|
||||
+ .name = "rootfs",
|
||||
+ .size = 0x200000,
|
||||
+ .offset = 0x200000
|
||||
}
|
||||
};
|
||||
|
||||
@@ -281,6 +276,11 @@ static int __init init_axis_flash(void)
|
||||
struct partitiontable_entry *ptable;
|
||||
int use_default_ptable = 1; /* Until proven otherwise. */
|
||||
const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n";
|
||||
+ unsigned int kernel_part_size = 0;
|
||||
+ unsigned char *flash_mem = (unsigned char*)(FLASH_CACHED_ADDR);
|
||||
+ unsigned int flash_scan_count = 0;
|
||||
+ const char *part_magic = "ACME_PART_MAGIC";
|
||||
+ unsigned int magic_len = strlen(part_magic);
|
||||
|
||||
if (!(mymtd = flash_probe())) {
|
||||
/* There's no reason to use this module if no flash chip can
|
||||
@@ -293,6 +293,31 @@ static int __init init_axis_flash(void)
|
||||
axisflash_mtd = mymtd;
|
||||
}
|
||||
|
||||
+ /* scan flash to findout where out partition starts */
|
||||
+
|
||||
+ printk(KERN_INFO "Scanning flash for end of kernel magic\n");
|
||||
+ for(flash_scan_count = 0; flash_scan_count < 100000; flash_scan_count++) {
|
||||
+ if(strncmp(&flash_mem[flash_scan_count], part_magic, magic_len - 1) == 0) {
|
||||
+ kernel_part_size = flash_mem[flash_scan_count + magic_len ];
|
||||
+ kernel_part_size <<= 8;
|
||||
+ kernel_part_size += flash_mem[flash_scan_count + magic_len + 2];
|
||||
+ kernel_part_size <<= 8;
|
||||
+ kernel_part_size += flash_mem[flash_scan_count + magic_len + 1];
|
||||
+ kernel_part_size <<= 8;
|
||||
+ kernel_part_size += flash_mem[flash_scan_count + magic_len + 3];
|
||||
+ printk(KERN_INFO "Kernel ends at 0x%.08X\n", kernel_part_size);
|
||||
+ flash_scan_count = 1100000;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ if(kernel_part_size){
|
||||
+ kernel_part_size = (kernel_part_size & 0xffff0000);
|
||||
+ axis_default_partitions[0].size = kernel_part_size;
|
||||
+ axis_default_partitions[1].size = mymtd->size - axis_default_partitions[0].size;
|
||||
+ axis_default_partitions[1].offset = axis_default_partitions[0].size;
|
||||
+ }
|
||||
+
|
||||
if (mymtd) {
|
||||
mymtd->owner = THIS_MODULE;
|
||||
ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
|
||||
--- a/arch/cris/arch-v10/lib/hw_settings.S
|
||||
+++ b/arch/cris/arch-v10/lib/hw_settings.S
|
||||
@@ -60,3 +60,5 @@
|
||||
.dword R_PORT_PB_SET
|
||||
.dword PB_SET_VALUE
|
||||
.dword 0 ; No more register values
|
||||
+ .ascii "ACME_PART_MAGIC"
|
||||
+ .dword 0xdeadc0de
|
|
@ -1,20 +0,0 @@
|
|||
--- a/drivers/usb/host/Makefile
|
||||
+++ b/drivers/usb/host/Makefile
|
||||
@@ -28,6 +28,7 @@ obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
|
||||
obj-$(CONFIG_USB_XHCI_HCD) += xhci.o
|
||||
obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o
|
||||
obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o
|
||||
+obj-$(CONFIG_ETRAX_USB_HOST) += hc-crisv10.o
|
||||
obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o
|
||||
obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
|
||||
obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o
|
||||
--- a/drivers/usb/Makefile
|
||||
+++ b/drivers/usb/Makefile
|
||||
@@ -21,6 +21,7 @@ obj-$(CONFIG_USB_U132_HCD) += host/
|
||||
obj-$(CONFIG_USB_R8A66597_HCD) += host/
|
||||
obj-$(CONFIG_USB_HWA_HCD) += host/
|
||||
obj-$(CONFIG_USB_ISP1760_HCD) += host/
|
||||
+obj-$(CONFIG_ETRAX_USB_HOST) += host/
|
||||
|
||||
obj-$(CONFIG_USB_C67X00_HCD) += c67x00/
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
--- a/arch/cris/Kconfig
|
||||
+++ b/arch/cris/Kconfig
|
||||
@@ -649,6 +649,8 @@ endchoice
|
||||
|
||||
endmenu
|
||||
|
||||
+menu "Device Drivers"
|
||||
+
|
||||
source "drivers/base/Kconfig"
|
||||
|
||||
# standard linux drivers
|
||||
@@ -660,13 +662,19 @@ source "drivers/pnp/Kconfig"
|
||||
|
||||
source "drivers/block/Kconfig"
|
||||
|
||||
+# misc before ide - BLK_DEV_SGIIOC4 depends on SGI_IOC4
|
||||
+
|
||||
+source "drivers/misc/Kconfig"
|
||||
+
|
||||
source "drivers/ide/Kconfig"
|
||||
|
||||
-source "drivers/net/Kconfig"
|
||||
+source "drivers/scsi/Kconfig"
|
||||
|
||||
-source "drivers/i2c/Kconfig"
|
||||
+source "drivers/ata/Kconfig"
|
||||
|
||||
-source "drivers/rtc/Kconfig"
|
||||
+source "drivers/net/Kconfig"
|
||||
+
|
||||
+source "drivers/isdn/Kconfig"
|
||||
|
||||
#
|
||||
# input before char - char/joystick depends on it. As does USB.
|
||||
@@ -675,14 +683,50 @@ source "drivers/input/Kconfig"
|
||||
|
||||
source "drivers/char/Kconfig"
|
||||
|
||||
-source "fs/Kconfig"
|
||||
+source "drivers/i2c/Kconfig"
|
||||
+
|
||||
+#source "drivers/spi/Kconfig"
|
||||
+
|
||||
+source "drivers/gpio/Kconfig"
|
||||
+
|
||||
+source "drivers/w1/Kconfig"
|
||||
+
|
||||
+source "drivers/power/Kconfig"
|
||||
+
|
||||
+source "drivers/hwmon/Kconfig"
|
||||
+
|
||||
+source "drivers/thermal/Kconfig"
|
||||
+
|
||||
+source "drivers/watchdog/Kconfig"
|
||||
+
|
||||
+source "drivers/ssb/Kconfig"
|
||||
+
|
||||
+#source "drivers/l3/Kconfig"
|
||||
+
|
||||
+source "drivers/mfd/Kconfig"
|
||||
+
|
||||
+source "drivers/media/Kconfig"
|
||||
+
|
||||
+source "drivers/video/Kconfig"
|
||||
+
|
||||
+source "sound/Kconfig"
|
||||
+
|
||||
+source "drivers/hid/Kconfig"
|
||||
|
||||
source "drivers/usb/Kconfig"
|
||||
|
||||
source "drivers/uwb/Kconfig"
|
||||
|
||||
+source "drivers/leds/Kconfig"
|
||||
+
|
||||
+source "drivers/rtc/Kconfig"
|
||||
+
|
||||
source "drivers/staging/Kconfig"
|
||||
|
||||
+endmenu
|
||||
+
|
||||
+source "fs/Kconfig"
|
||||
+
|
||||
source "arch/cris/Kconfig.debug"
|
||||
|
||||
source "security/Kconfig"
|
|
@ -1,54 +0,0 @@
|
|||
--- a/arch/cris/arch-v10/drivers/Kconfig
|
||||
+++ b/arch/cris/arch-v10/drivers/Kconfig
|
||||
@@ -450,11 +450,31 @@ config ETRAX_I2C
|
||||
i2c_arg = I2C_READARG(STA013_READ_ADDR, reg);
|
||||
val = ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_READREG), i2c_arg);
|
||||
|
||||
+config ETRAX_I2C_GVC
|
||||
+ bool "I2C GVC support"
|
||||
+ depends on ETRAX_ARCH_V10 && !ETRAX_I2C
|
||||
+ select ETRAX_I2C_USES_PB_NOT_PB_I2C
|
||||
+ help
|
||||
+ Enables an I2C driver with Geert Vancompernolle improvement.
|
||||
+
|
||||
+config ETRAX_I2C_SLAVE_DELAY
|
||||
+ bool "I2C Slave delay support"
|
||||
+ depends on ETRAX_I2C_GVC && EXPERIMENTAL
|
||||
+ help
|
||||
+ Enable this to enhanced master/slave dialog
|
||||
+ Improvement by Positive Going (www.positivegoing.it) and BK srl (www.b-k.it)
|
||||
+
|
||||
+config ETRAX_I2C_DYN_ALLOC
|
||||
+ bool "I2C major device dynamic alloc"
|
||||
+ depends on ETRAX_I2C_GVC && EXPERIMENTAL
|
||||
+ help
|
||||
+ Enable this to dynamicaly alloc major i2c device number
|
||||
+
|
||||
# this is true for most products since PB-I2C seems to be somewhat
|
||||
# flawed..
|
||||
config ETRAX_I2C_USES_PB_NOT_PB_I2C
|
||||
bool "I2C uses PB not PB-I2C"
|
||||
- depends on ETRAX_I2C
|
||||
+ depends on ETRAX_I2C || ETRAX_I2C_GVC
|
||||
help
|
||||
Select whether to use the special I2C mode in the PB I/O register or
|
||||
not. This option needs to be selected in order to use some drivers
|
||||
@@ -478,7 +498,7 @@ config ETRAX_I2C_CLK_PORT
|
||||
|
||||
config ETRAX_I2C_EEPROM
|
||||
bool "I2C EEPROM (non-volatile RAM) support"
|
||||
- depends on ETRAX_I2C
|
||||
+ depends on ETRAX_I2C || ETRAX_I2C_GVC
|
||||
help
|
||||
Enables I2C EEPROM (non-volatile RAM) on PB0 and PB1 using the I2C
|
||||
driver. Select size option: Probed, 2k, 8k, 16k.
|
||||
--- a/arch/cris/arch-v10/drivers/Makefile
|
||||
+++ b/arch/cris/arch-v10/drivers/Makefile
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o
|
||||
obj-$(CONFIG_ETRAX_I2C) += i2c.o
|
||||
+obj-$(CONFIG_ETRAX_I2C_GVC) += i2c_gvc.o
|
||||
obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o
|
||||
obj-$(CONFIG_ETRAX_GPIO) += gpio.o
|
||||
obj-$(CONFIG_ETRAX_DS1302) += ds1302.o
|
|
@ -1,44 +0,0 @@
|
|||
--- a/drivers/serial/crisv10.c
|
||||
+++ b/drivers/serial/crisv10.c
|
||||
@@ -32,6 +32,7 @@ static char *serial_version = "$Revision
|
||||
#include <linux/module.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/io.h>
|
||||
+#include <linux/device.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/dma.h>
|
||||
@@ -4415,6 +4416,8 @@ static const struct tty_operations rs_op
|
||||
#endif
|
||||
};
|
||||
|
||||
+static struct class *rs_class;
|
||||
+
|
||||
static int __init rs_init(void)
|
||||
{
|
||||
int i;
|
||||
@@ -4548,6 +4551,24 @@ static int __init rs_init(void)
|
||||
#endif
|
||||
#endif /* CONFIG_SVINTO_SIM */
|
||||
|
||||
+ rs_class = class_create(THIS_MODULE, "rs_tty");
|
||||
+#ifdef CONFIG_ETRAX_SERIAL_PORT0
|
||||
+ device_create(rs_class, NULL,
|
||||
+ MKDEV(TTY_MAJOR, 64), NULL, "ttyS0");
|
||||
+#endif
|
||||
+#ifdef CONFIG_ETRAX_SERIAL_PORT1
|
||||
+ device_create(rs_class, NULL,
|
||||
+ MKDEV(TTY_MAJOR, 65), NULL, "ttyS1");
|
||||
+#endif
|
||||
+#ifdef CONFIG_ETRAX_SERIAL_PORT2
|
||||
+ device_create(rs_class, NULL,
|
||||
+ MKDEV(TTY_MAJOR, 66), NULL, "ttyS2");
|
||||
+#endif
|
||||
+#ifdef CONFIG_ETRAX_SERIAL_PORT3
|
||||
+ device_create(rs_class, NULL,
|
||||
+ MKDEV(TTY_MAJOR, 67), NULL, "ttyS3");
|
||||
+#endif
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
--- a/arch/cris/arch-v10/drivers/gpio.c
|
||||
+++ b/arch/cris/arch-v10/drivers/gpio.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/poll.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
+#include <linux/device.h>
|
||||
|
||||
#include <asm/etraxgpio.h>
|
||||
#include <arch/svinto.h>
|
||||
@@ -771,6 +772,8 @@ static void ioif_watcher(const unsigned
|
||||
|
||||
/* main driver initialization routine, called from mem.c */
|
||||
|
||||
+static struct class *gp_class;
|
||||
+
|
||||
static int __init gpio_init(void)
|
||||
{
|
||||
int res;
|
||||
@@ -784,6 +787,8 @@ static int __init gpio_init(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
+ gp_class = class_create(THIS_MODULE, "gpio_etrax");
|
||||
+
|
||||
/* Clear all leds */
|
||||
#if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
|
||||
CRIS_LED_NETWORK_SET(0);
|
||||
@@ -796,6 +801,8 @@ static int __init gpio_init(void)
|
||||
CRIS_LED_BIT_SET(i);
|
||||
#endif
|
||||
|
||||
+ device_create(gp_class, NULL,
|
||||
+ MKDEV(GPIO_MAJOR, 2), NULL, "leds");
|
||||
#endif
|
||||
/* The I/O interface allocation watcher will be called when
|
||||
* registering it. */
|
||||
@@ -822,6 +829,12 @@ static int __init gpio_init(void)
|
||||
if (res)
|
||||
printk(KERN_CRIT "err: PA irq for gpio\n");
|
||||
|
||||
+ device_create(gp_class, NULL,
|
||||
+ MKDEV(GPIO_MAJOR, 0), NULL, "gpioa");
|
||||
+ device_create(gp_class, NULL,
|
||||
+ MKDEV(GPIO_MAJOR, 1), NULL, "gpiob");
|
||||
+ device_create(gp_class, NULL,
|
||||
+ MKDEV(GPIO_MAJOR, 3), NULL, "gpiog");
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
--- a/arch/cris/arch-v10/drivers/i2c.c
|
||||
+++ b/arch/cris/arch-v10/drivers/i2c.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/init.h>
|
||||
+#include <linux/device.h>
|
||||
|
||||
#include <asm/etraxi2c.h>
|
||||
|
||||
@@ -678,6 +679,8 @@ i2c_init(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
+static struct class *i2c_class;
|
||||
+
|
||||
static int __init
|
||||
i2c_register(void)
|
||||
{
|
||||
@@ -693,7 +696,11 @@ i2c_register(void)
|
||||
}
|
||||
|
||||
printk(KERN_INFO "I2C driver v2.2, (c) 1999-2004 Axis Communications AB\n");
|
||||
-
|
||||
+
|
||||
+ i2c_class = class_create(THIS_MODULE, "i2c_etrax");
|
||||
+ device_create(i2c_class, NULL,
|
||||
+ MKDEV(I2C_MAJOR, 0), NULL, "i2c");
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
--- a/arch/cris/include/arch-v10/arch/Kbuild
|
||||
+++ b/arch/cris/include/arch-v10/arch/Kbuild
|
||||
@@ -1,3 +1,5 @@
|
||||
+header-y += elf.h
|
||||
+header-y += ptrace.h
|
||||
header-y += user.h
|
||||
header-y += svinto.h
|
||||
header-y += sv_addr_ag.h
|
||||
--- a/arch/cris/include/asm/Kbuild
|
||||
+++ b/arch/cris/include/asm/Kbuild
|
||||
@@ -1,11 +1,14 @@
|
||||
include include/asm-generic/Kbuild.asm
|
||||
|
||||
-header-y += arch-v10/
|
||||
-header-y += arch-v32/
|
||||
+header-y += ../arch-v10/arch/
|
||||
+header-y += ../arch-v32/arch/
|
||||
|
||||
+header-y += elf.h
|
||||
header-y += ethernet.h
|
||||
+header-y += page.h
|
||||
header-y += rtc.h
|
||||
header-y += sync_serial.h
|
||||
+header-y += user.h
|
||||
|
||||
unifdef-y += etraxgpio.h
|
||||
unifdef-y += rs485.h
|
|
@ -1,16 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
define Profile/default
|
||||
NAME:=Normal (default)
|
||||
endef
|
||||
|
||||
define Profile/default/Description
|
||||
Normal Foxboard setup
|
||||
endef
|
||||
$(eval $(call Profile,default))
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
define Profile/vhdl_no_fb
|
||||
NAME:=FOXVHDL no fb
|
||||
endef
|
||||
|
||||
define Profile/vhdl_no_fb/Description
|
||||
Setup the Foxboard for FOXVHDL support with no framebuffer
|
||||
endef
|
||||
$(eval $(call Profile,vhdl_no_fb))
|
||||
|
Loading…
Reference in New Issue