parent
6720686d55
commit
4e7ea16048
@ -1,191 +0,0 @@
|
||||
#include <linux/autoconf.h>
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/gpio_syscalls.h>
|
||||
|
||||
#include <asm/etraxgpio.h>
|
||||
#include <asm/arch/svinto.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/arch/io_interface_mux.h>
|
||||
|
||||
#include <asm/unistd.h>
|
||||
|
||||
|
||||
extern int errno;
|
||||
|
||||
|
||||
asmlinkage void sys_gpiosetbits(unsigned char port, unsigned int bits){
|
||||
switch(port){
|
||||
case 'G':
|
||||
case 'g':
|
||||
*R_PORT_G_DATA = port_g_data_shadow |= bits;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
case 'a':
|
||||
*R_PORT_PA_DATA = port_pa_data_shadow |= bits;
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
*R_PORT_PB_DATA = port_pb_data_shadow |= bits;
|
||||
break;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
asmlinkage void sys_gpioclearbits(unsigned char port, unsigned int bits){
|
||||
switch(port){
|
||||
case 'G':
|
||||
case 'g':
|
||||
*R_PORT_G_DATA = port_g_data_shadow &= ~bits;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
case 'a':
|
||||
*R_PORT_PA_DATA = port_pa_data_shadow &= ~bits;
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
*R_PORT_PB_DATA = port_pb_data_shadow &= ~bits;
|
||||
break;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
asmlinkage void sys_gpiosetdir(unsigned char port, unsigned char dir, unsigned int bits){
|
||||
if((dir=='I' )||(dir=='i')){
|
||||
switch(port){
|
||||
case 'G':
|
||||
case 'g':
|
||||
if(bits & (1<<0)){
|
||||
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g0dir);
|
||||
};
|
||||
if((bits & 0x0000FF00)==0x0000FF00){
|
||||
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g8_15dir);
|
||||
};
|
||||
if((bits & 0x00FF0000)==0x00FF0000){
|
||||
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g16_23dir);
|
||||
};
|
||||
if(bits & (1<<24)){
|
||||
genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, g24dir);
|
||||
};
|
||||
*R_GEN_CONFIG = genconfig_shadow;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
case 'a':
|
||||
*R_PORT_PA_DIR = port_pa_dir_shadow &= ~(bits & 0xff);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
*R_PORT_PB_DIR = port_pb_dir_shadow &= ~(bits & 0xff);
|
||||
break;
|
||||
};
|
||||
} else if((dir=='O' )||(dir=='o')){
|
||||
switch(port){
|
||||
case 'G':
|
||||
case 'g':
|
||||
if(bits & (1<<0)){
|
||||
genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g0dir);
|
||||
};
|
||||
if((bits & 0x0000FF00)==0x0000FF00){
|
||||
genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g8_15dir);
|
||||
};
|
||||
if((bits & 0x00FF0000)==0x00FF0000){
|
||||
genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g8_15dir);
|
||||
};
|
||||
if(bits & (1<<24)){
|
||||
genconfig_shadow |= IO_MASK(R_GEN_CONFIG, g24dir);
|
||||
};
|
||||
*R_GEN_CONFIG = genconfig_shadow;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
case 'a':
|
||||
*R_PORT_PA_DIR = port_pa_dir_shadow |= (bits & 0xff);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
*R_PORT_PB_DIR = port_pb_dir_shadow |= (bits & 0xff);
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
asmlinkage void sys_gpiotogglebit(unsigned char port, unsigned int bits){
|
||||
switch(port){
|
||||
case 'G':
|
||||
case 'g':
|
||||
if(port_g_data_shadow & bits){
|
||||
*R_PORT_G_DATA = port_g_data_shadow &= ~bits;
|
||||
} else {
|
||||
*R_PORT_G_DATA = port_g_data_shadow |= bits;
|
||||
};
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
case 'a':
|
||||
if(*R_PORT_PA_DATA & bits){
|
||||
*R_PORT_PA_DATA = port_pa_data_shadow &= ~(bits & 0xff);
|
||||
} else {
|
||||
*R_PORT_PA_DATA = port_pa_data_shadow |= (bits & 0xff);
|
||||
};
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
if(*R_PORT_PB_DATA & bits){
|
||||
*R_PORT_PB_DATA = port_pb_data_shadow &= ~(bits & 0xff);
|
||||
} else {
|
||||
*R_PORT_PB_DATA = port_pb_data_shadow |= (bits & 0xff);
|
||||
};
|
||||
break;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
asmlinkage unsigned int sys_gpiogetbits(unsigned char port, unsigned int bits){
|
||||
unsigned int data = 0;
|
||||
switch(port){
|
||||
case 'G':
|
||||
case 'g':
|
||||
data = *R_PORT_G_DATA;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
case 'a':
|
||||
data = *R_PORT_PA_DATA;
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
data = *R_PORT_PB_DATA;
|
||||
break;
|
||||
|
||||
};
|
||||
data &= bits;
|
||||
return data;
|
||||
};
|
||||
|
||||
|
@ -1,262 +0,0 @@
|
||||
/*
|
||||
* Simple bitbanged-GPIO SPI driver for ETRAX FS et al.
|
||||
*
|
||||
* Copyright (c) 2007 Axis Communications AB
|
||||
*
|
||||
* Author: Hans-Peter Nilsson, inspired by earlier work by
|
||||
* Andre Spanberg but mostly by copying large parts of
|
||||
* spi_s3c24xx_gpio.c, hence also:
|
||||
* Copyright (c) 2006 Ben Dooks
|
||||
* Copyright (c) 2006 Simtec Electronics
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/spi_bitbang.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
/* Our main driver state. */
|
||||
|
||||
struct crisv32_spi_hw_info {
|
||||
struct crisv32_iopin sclk;
|
||||
struct crisv32_iopin mosi;
|
||||
struct crisv32_iopin miso;
|
||||
struct crisv32_iopin cs;
|
||||
};
|
||||
|
||||
/*
|
||||
* The driver state hides behind the spi_bitbang state. We're
|
||||
* responsible for allocating that, so we can get a little something
|
||||
* for ourselves.
|
||||
*/
|
||||
|
||||
struct crisv32_spi_gpio_devdata {
|
||||
struct spi_bitbang bitbang;
|
||||
struct crisv32_spi_hw_info pins;
|
||||
};
|
||||
|
||||
/* Helper function getting the driver state from a spi_device. */
|
||||
|
||||
static inline struct crisv32_spi_hw_info *spidev_to_hw(struct spi_device *spi)
|
||||
{
|
||||
struct crisv32_spi_gpio_devdata *dd = spi_master_get_devdata(spi->master);
|
||||
return &dd->pins;
|
||||
}
|
||||
|
||||
/* The SPI-bitbang functions: see spi_bitbang.h at EXPAND_BITBANG_TXRX. */
|
||||
|
||||
static inline void setsck(struct spi_device *spi, int is_on)
|
||||
{
|
||||
crisv32_io_set(&spidev_to_hw(spi)->sclk, is_on != 0);
|
||||
}
|
||||
|
||||
static inline void setmosi(struct spi_device *spi, int is_on)
|
||||
{
|
||||
crisv32_io_set(&spidev_to_hw(spi)->mosi, is_on != 0);
|
||||
}
|
||||
|
||||
static inline u32 getmiso(struct spi_device *spi)
|
||||
{
|
||||
return crisv32_io_rd(&spidev_to_hw(spi)->miso) != 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
#define spidelay(x) ndelay(x)
|
||||
|
||||
#define EXPAND_BITBANG_TXRX
|
||||
#include <linux/spi/spi_bitbang.h>
|
||||
|
||||
/*
|
||||
* SPI-bitbang word transmit-functions for the four SPI modes,
|
||||
* dispatching to the inlined functions we just included.
|
||||
*/
|
||||
|
||||
static u32 crisv32_spi_gpio_txrx_mode0(struct spi_device *spi,
|
||||
unsigned nsecs, u32 word, u8 bits)
|
||||
{
|
||||
return bitbang_txrx_be_cpha0(spi, nsecs, 0, word, bits);
|
||||
}
|
||||
|
||||
static u32 crisv32_spi_gpio_txrx_mode1(struct spi_device *spi,
|
||||
unsigned nsecs, u32 word, u8 bits)
|
||||
{
|
||||
return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits);
|
||||
}
|
||||
|
||||
static u32 crisv32_spi_gpio_txrx_mode2(struct spi_device *spi,
|
||||
unsigned nsecs, u32 word, u8 bits)
|
||||
{
|
||||
return bitbang_txrx_be_cpha0(spi, nsecs, 1, word, bits);
|
||||
}
|
||||
|
||||
static u32 crisv32_spi_gpio_txrx_mode3(struct spi_device *spi,
|
||||
unsigned nsecs, u32 word, u8 bits)
|
||||
{
|
||||
return bitbang_txrx_be_cpha1(spi, nsecs, 1, word, bits);
|
||||
}
|
||||
|
||||
/* SPI-bitbang chip-select function. */
|
||||
|
||||
static void crisv32_spi_gpio_chipselect(struct spi_device *spi, int value)
|
||||
{
|
||||
if (spi->mode & SPI_CS_HIGH)
|
||||
crisv32_io_set(&spidev_to_hw(spi)->cs,
|
||||
value == BITBANG_CS_ACTIVE ? 1 : 0);
|
||||
else
|
||||
crisv32_io_set(&spidev_to_hw(spi)->cs,
|
||||
value == BITBANG_CS_ACTIVE ? 0 : 1);
|
||||
}
|
||||
|
||||
/* Platform-device probe function. */
|
||||
|
||||
static int __devinit crisv32_spi_gpio_probe(struct platform_device *dev)
|
||||
{
|
||||
struct spi_master *master;
|
||||
struct crisv32_spi_gpio_devdata *dd;
|
||||
struct resource *res;
|
||||
struct crisv32_spi_gpio_controller_data *gc;
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
* We need to get the controller data as a hardware resource,
|
||||
* or else it wouldn't be available until *after* the
|
||||
* spi_bitbang_start call!
|
||||
*/
|
||||
res = platform_get_resource_byname(dev, 0, "controller_data_ptr");
|
||||
if (res == NULL) {
|
||||
dev_err(&dev->dev, "can't get controller_data resource\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
gc = (struct crisv32_spi_gpio_controller_data *) res->start;
|
||||
|
||||
master = spi_alloc_master(&dev->dev, sizeof *dd);
|
||||
if (master == NULL) {
|
||||
dev_err(&dev->dev, "failed to allocate spi master\n");
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
dd = spi_master_get_devdata(master);
|
||||
platform_set_drvdata(dev, dd);
|
||||
|
||||
/*
|
||||
* The device data asks for this driver, and holds the id
|
||||
* number, which must be unique among the same-type devices.
|
||||
* We use this as the number of this SPI bus.
|
||||
*/
|
||||
master->bus_num = dev->id;
|
||||
|
||||
/*
|
||||
* Allocate pins. Note that thus being allocated as GPIO, we
|
||||
* don't have to deconfigure them at the end or if something
|
||||
* fails.
|
||||
*/
|
||||
if ((ret = crisv32_io_get_name(&dd->pins.cs, gc->cs)) != 0
|
||||
|| (ret = crisv32_io_get_name(&dd->pins.miso, gc->miso)) != 0
|
||||
|| (ret = crisv32_io_get_name(&dd->pins.mosi, gc->mosi)) != 0
|
||||
|| (ret = crisv32_io_get_name(&dd->pins.sclk, gc->sclk)) != 0)
|
||||
goto err_no_pins;
|
||||
|
||||
/* Set directions of the SPI pins. */
|
||||
crisv32_io_set_dir(&dd->pins.cs, crisv32_io_dir_out);
|
||||
crisv32_io_set_dir(&dd->pins.sclk, crisv32_io_dir_out);
|
||||
crisv32_io_set_dir(&dd->pins.miso, crisv32_io_dir_in);
|
||||
crisv32_io_set_dir(&dd->pins.mosi, crisv32_io_dir_out);
|
||||
|
||||
/* Set state of the SPI pins. */
|
||||
dev_dbg(&dev->dev, "cs.port 0x%x, pin: %d\n"
|
||||
dd->pins.cs.port, dd->pins.cs.bit);
|
||||
|
||||
/*
|
||||
* Can't use crisv32_spi_gpio_chipselect(spi, 1) here; we
|
||||
* don't have a proper "spi" until after spi_bitbang_start.
|
||||
*/
|
||||
crisv32_io_set(&dd->pins.cs, 1);
|
||||
crisv32_io_set(&dd->pins.sclk, 0);
|
||||
crisv32_io_set(&dd->pins.mosi, 0);
|
||||
|
||||
/* Setup SPI bitbang adapter hooks. */
|
||||
dd->bitbang.master = spi_master_get(master);
|
||||
dd->bitbang.chipselect = crisv32_spi_gpio_chipselect;
|
||||
|
||||
dd->bitbang.txrx_word[SPI_MODE_0] = crisv32_spi_gpio_txrx_mode0;
|
||||
dd->bitbang.txrx_word[SPI_MODE_1] = crisv32_spi_gpio_txrx_mode1;
|
||||
dd->bitbang.txrx_word[SPI_MODE_2] = crisv32_spi_gpio_txrx_mode2;
|
||||
dd->bitbang.txrx_word[SPI_MODE_3] = crisv32_spi_gpio_txrx_mode3;
|
||||
|
||||
ret = spi_bitbang_start(&dd->bitbang);
|
||||
if (ret)
|
||||
goto err_no_bitbang;
|
||||
|
||||
printk (KERN_INFO "CRIS v32 SPI driver for GPIO"
|
||||
" (cs: %s, miso: %s, mosi: %s, sclk: %s)\n",
|
||||
gc->cs, gc->miso, gc->mosi, gc->sclk);
|
||||
|
||||
return 0;
|
||||
|
||||
err_no_bitbang:
|
||||
spi_master_put(dd->bitbang.master);
|
||||
err_no_pins:
|
||||
platform_set_drvdata(dev, NULL);
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Platform-device remove-function. */
|
||||
|
||||
static int __devexit crisv32_spi_gpio_remove(struct platform_device *dev)
|
||||
{
|
||||
struct crisv32_spi_gpio_devdata *dd = platform_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
ret = spi_bitbang_stop(&dd->bitbang);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
spi_master_put(dd->bitbang.master);
|
||||
platform_set_drvdata(dev, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* For the time being, there's no suspend/resume support to care
|
||||
* about, so we let those handlers default to NULL.
|
||||
*/
|
||||
static struct platform_driver crisv32_spi_gpio_drv = {
|
||||
.probe = crisv32_spi_gpio_probe,
|
||||
.remove = __devexit_p(crisv32_spi_gpio_remove),
|
||||
.driver = {
|
||||
.name = "spi_crisv32_gpio",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
|
||||
/* Module init function. */
|
||||
|
||||
static int __devinit crisv32_spi_gpio_init(void)
|
||||
{
|
||||
return platform_driver_register(&crisv32_spi_gpio_drv);
|
||||
}
|
||||
|
||||
/* Module exit function. */
|
||||
|
||||
static void __devexit crisv32_spi_gpio_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&crisv32_spi_gpio_drv);
|
||||
}
|
||||
|
||||
module_init(crisv32_spi_gpio_init);
|
||||
module_exit(crisv32_spi_gpio_exit);
|
||||
|
||||
MODULE_DESCRIPTION("CRIS v32 SPI-GPIO Driver");
|
||||
MODULE_AUTHOR("Hans-Peter Nilsson, <hp@axis.com>");
|
||||
MODULE_LICENSE("GPL");
|
File diff suppressed because it is too large
Load Diff
@ -1,141 +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; \
|
||||
})
|
@ -1,10 +0,0 @@
|
||||
#ifndef __MTD_MTDRAM_H__
|
||||
#define __MTD_MTDRAM_H__
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/mtd/mtd.h>
|
||||
int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
|
||||
unsigned long size, char *name);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __MTD_MTDRAM_H__ */
|
@ -0,0 +1,139 @@
|
||||
Index: linux-2.6.25/arch/cris/mm/init.c
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/arch/cris/mm/init.c 2008-05-03 09:53:53.000000000 +0100
|
||||
+++ linux-2.6.25/arch/cris/mm/init.c 2008-05-03 09:54:05.000000000 +0100
|
||||
@@ -112,3 +112,7 @@
|
||||
printk (KERN_INFO "Freeing unused kernel memory: %luk freed\n",
|
||||
(unsigned long)((&__init_end - &__init_begin) >> 10));
|
||||
}
|
||||
+
|
||||
+void free_initrd_mem(unsigned long start, unsigned long end)
|
||||
+{
|
||||
+}
|
||||
Index: linux-2.6.25/arch/cris/boot/compressed/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/arch/cris/boot/compressed/Makefile 2008-05-03 10:00:53.000000000 +0100
|
||||
+++ linux-2.6.25/arch/cris/boot/compressed/Makefile 2008-05-03 10:01:12.000000000 +0100
|
||||
@@ -7,7 +7,7 @@
|
||||
LD = ld-cris
|
||||
ldflags-y += -T $(obj)/decompress.ld
|
||||
OBJECTS = $(obj)/head.o $(obj)/misc.o
|
||||
-OBJCOPY = objcopy-cris
|
||||
+OBJCOPY = /usr/local/cris/objcopy-cris
|
||||
OBJCOPYFLAGS = -O binary --remove-section=.bss
|
||||
|
||||
quiet_cmd_image = BUILD $@
|
||||
Index: linux-2.6.25/arch/cris/boot/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/arch/cris/boot/Makefile 2008-04-17 03:49:44.000000000 +0100
|
||||
+++ linux-2.6.25/arch/cris/boot/Makefile 2008-05-03 10:05:56.000000000 +0100
|
||||
@@ -2,10 +2,10 @@
|
||||
# arch/cris/arch-v10/boot/Makefile
|
||||
#
|
||||
|
||||
-OBJCOPY = objcopy-cris
|
||||
+OBJCOPY = /usr/local/cris/objcopy-cris
|
||||
OBJCOPYFLAGS = -O binary --remove-section=.bss
|
||||
|
||||
-subdir- := compressed rescue
|
||||
+subdir- := compressed
|
||||
targets := Image
|
||||
|
||||
$(obj)/Image: vmlinux FORCE
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
$(obj)/compressed/vmlinux: $(obj)/Image FORCE
|
||||
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
||||
- $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
|
||||
|
||||
$(obj)/zImage: $(obj)/compressed/vmlinux
|
||||
@cp $< $@
|
||||
Index: linux-2.6.25/arch/cris/boot/compressed/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/arch/cris/boot/compressed/Makefile 2008-05-03 10:01:12.000000000 +0100
|
||||
+++ linux-2.6.25/arch/cris/boot/compressed/Makefile 2008-05-03 16:29:55.000000000 +0100
|
||||
@@ -2,9 +2,8 @@
|
||||
# arch/cris/arch-v10/boot/compressed/Makefile
|
||||
#
|
||||
|
||||
-CC = gcc-cris -melf $(LINUXINCLUDE)
|
||||
ccflags-y += -O2
|
||||
-LD = ld-cris
|
||||
+LD=/usr/local/cris/ld-cris
|
||||
ldflags-y += -T $(obj)/decompress.ld
|
||||
OBJECTS = $(obj)/head.o $(obj)/misc.o
|
||||
OBJCOPY = /usr/local/cris/objcopy-cris
|
||||
@@ -22,10 +21,10 @@
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
$(obj)/head.o: $(obj)/head.S .config
|
||||
- @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
|
||||
+ /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__ASSEMBLY__ -traditional -c $< -o $@
|
||||
|
||||
$(obj)/misc.o: $(obj)/misc.c .config
|
||||
- @$(CC) -D__KERNEL__ -c $< -o $@
|
||||
+ /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__KERNEL__ -c $< -o $@
|
||||
|
||||
$(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
|
||||
$(call if_changed,image)
|
||||
Index: linux-2.6.25/arch/cris/boot/compressed/misc.c
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/arch/cris/boot/compressed/misc.c 2008-05-03 16:22:44.000000000 +0100
|
||||
+++ linux-2.6.25/arch/cris/boot/compressed/misc.c 2008-05-03 16:23:26.000000000 +0100
|
||||
@@ -5,7 +5,7 @@
|
||||
* adapted for Linux.
|
||||
*
|
||||
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
|
||||
- * puts by Nick Holloway 1993, better puts by Martin Mares 1995
|
||||
+ * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
|
||||
* adaptation for Linux/CRIS Axis Communications AB, 1999
|
||||
*
|
||||
*/
|
||||
@@ -99,7 +99,7 @@
|
||||
static void gzip_mark(void **);
|
||||
static void gzip_release(void **);
|
||||
|
||||
-static void puts(const char *);
|
||||
+static void putstr(const char *);
|
||||
|
||||
/* the "heap" is put directly after the BSS ends, at end */
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
/* decompressor info and error messages to serial console */
|
||||
|
||||
static void
|
||||
-puts(const char *s)
|
||||
+putstr(const char *s)
|
||||
{
|
||||
#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
|
||||
while(*s) {
|
||||
@@ -209,9 +209,9 @@
|
||||
static void
|
||||
error(char *x)
|
||||
{
|
||||
- puts("\n\n");
|
||||
- puts(x);
|
||||
- puts("\n\n -- System halted\n");
|
||||
+ putstr("\n\n");
|
||||
+ putstr(x);
|
||||
+ putstr("\n\n -- System halted\n");
|
||||
|
||||
while(1); /* Halt */
|
||||
}
|
||||
@@ -257,14 +257,7 @@
|
||||
|
||||
makecrc();
|
||||
|
||||
- __asm__ volatile ("move vr,%0" : "=rm" (revision));
|
||||
- if (revision < 10)
|
||||
- {
|
||||
- puts("You need an ETRAX 100LX to run linux 2.6\n");
|
||||
- while(1);
|
||||
- }
|
||||
-
|
||||
- puts("Uncompressing Linux...\n");
|
||||
+ putstr("Uncompressing Linux...\n");
|
||||
gunzip();
|
||||
- puts("Done. Now booting the kernel.\n");
|
||||
+ putstr("Done. Now booting the kernel.\n");
|
||||
}
|
Loading…
Reference in New Issue