1 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/Makefile linux-2.6.16.7-patched/bcmdrivers/opensource/Makefile
2 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/Makefile 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/Makefile 2006-07-05 15:21:58.000000000 +0200
5 +# File: modules/drivers/Makefile
7 +# Makefile for the GPLed Linux kernel modules.
10 +LN_NAME=bcm9$(BRCM_CHIP)
13 +-include $(KERNEL_DIR)/.config
15 +ifneq ($(CONFIG_BCM_SERIAL),)
16 + LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_SERIAL_IMPL) char/serial/$(LN_NAME);
19 +obj-$(CONFIG_BCM_SERIAL) += char/serial/impl$(CONFIG_BCM_SERIAL_IMPL)/
23 + find . -lname "*" -name "$(LN_NAME)" -print -exec rm -f "{}" ";"
24 + $(CONFIG_SHELL) -c "$(LN_DRIVER_DIRS)"
25 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/char/serial/impl1/Makefile linux-2.6.16.7-patched/bcmdrivers/opensource/char/serial/impl1/Makefile
26 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/char/serial/impl1/Makefile 1970-01-01 01:00:00.000000000 +0100
27 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/char/serial/impl1/Makefile 2006-07-05 15:21:58.000000000 +0200
29 +# File: bcmdrivers/opensource/char/serial
31 +# Makefile for the BCM63xx serial/console driver
33 +obj-$(CONFIG_BCM_SERIAL) += bcm63xx_cons.o
35 +EXTRA_CFLAGS += -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD)
37 +-include $(TOPDIR)/Rules.make
40 + rm -f core *.o *.a *.s
42 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/char/serial/impl1/bcm63xx_cons.c linux-2.6.16.7-patched/bcmdrivers/opensource/char/serial/impl1/bcm63xx_cons.c
43 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/char/serial/impl1/bcm63xx_cons.c 1970-01-01 01:00:00.000000000 +0100
44 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/char/serial/impl1/bcm63xx_cons.c 2006-07-05 15:21:58.000000000 +0200
48 + Copyright 2002 Broadcom Corp. All Rights Reserved.
50 + This program is free software; you can distribute it and/or modify it
51 + under the terms of the GNU General Public License (Version 2) as
52 + published by the Free Software Foundation.
54 + This program is distributed in the hope it will be useful, but WITHOUT
55 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
56 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
59 + You should have received a copy of the GNU General Public License along
60 + with this program; if not, write to the Free Software Foundation, Inc.,
61 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
65 +/* Description: Serial port driver for the BCM963XX. */
67 +#define CARDNAME "bcm963xx_serial driver"
68 +#define VERSION "2.0"
69 +#define VER_STR CARDNAME " v" VERSION "\n"
72 +#include <linux/kernel.h>
73 +#include <linux/module.h>
74 +#include <linux/version.h>
75 +#include <linux/init.h>
76 +#include <linux/slab.h>
77 +#include <linux/interrupt.h>
79 +/* for definition of struct console */
80 +#include <linux/console.h>
81 +#include <linux/tty.h>
82 +#include <linux/tty_flip.h>
83 +#include <linux/serial.h>
84 +#include <asm/uaccess.h>
86 +#include <bcmtypes.h>
88 +#include <bcm_map_part.h>
89 +#include <bcm_intr.h>
91 +extern void _putc(char);
92 +extern void _puts(const char *);
94 +typedef struct bcm_serial {
95 + volatile Uart * port;
101 + unsigned short close_delay;
102 + unsigned short closing_wait;
103 + unsigned short line; /* port/line number */
104 + unsigned short cflags; /* line configuration flag */
105 + unsigned short x_char; /* xon/xoff character */
106 + unsigned short read_status_mask; /* mask for read condition */
107 + unsigned short ignore_status_mask; /* mask for ignore condition */
108 + unsigned long event; /* mask used in BH */
109 + int xmit_head; /* Position of the head */
110 + int xmit_tail; /* Position of the tail */
111 + int xmit_cnt; /* Count of the chars in the buffer */
112 + int count; /* indicates how many times it has been opened */
115 + struct async_icount icount; /* keep track of things ... */
116 + struct tty_struct *tty; /* tty associated */
117 + struct termios normal_termios;
119 + wait_queue_head_t open_wait;
120 + wait_queue_head_t close_wait;
122 + long session; /* Session of opening process */
123 + long pgrp; /* pgrp of opening process */
125 + unsigned char is_initialized;
129 +/*---------------------------------------------------------------------*/
130 +/* Define bits in the Interrupt Enable register */
131 +/*---------------------------------------------------------------------*/
132 +/* Enable receive interrupt */
133 +#define RXINT (RXFIFONE|RXOVFERR)
135 +/* Enable transmit interrupt */
136 +#define TXINT (TXFIFOEMT|TXUNDERR|TXOVFERR)
138 +/* Enable receiver line status interrupt */
139 +#define LSINT (RXBRK|RXPARERR|RXFRAMERR)
141 +#define BCM_NUM_UARTS 1
143 +#define BD_BCM63XX_TIMER_CLOCK_INPUT (FPERIPH)
146 +static struct bcm_serial multi[BCM_NUM_UARTS];
147 +static struct bcm_serial *lines[BCM_NUM_UARTS];
148 +static struct tty_driver serial_driver;
149 +static struct tty_struct *serial_table[BCM_NUM_UARTS];
150 +static struct termios *serial_termios[BCM_NUM_UARTS];
151 +static struct termios *serial_termios_locked[BCM_NUM_UARTS];
152 +static int serial_refcount;
155 +static void bcm_stop (struct tty_struct *tty);
156 +static void bcm_start (struct tty_struct *tty);
157 +static inline void receive_chars (struct bcm_serial * info);
158 +static int startup (struct bcm_serial *info);
159 +static void shutdown (struct bcm_serial * info);
160 +static void change_speed( volatile Uart *pUart, tcflag_t cFlag );
161 +static void bcm63xx_cons_flush_chars (struct tty_struct *tty);
162 +static int bcm63xx_cons_write (struct tty_struct *tty, int from_user,
163 + const unsigned char *buf, int count);
164 +static int bcm63xx_cons_write_room (struct tty_struct *tty);
165 +static int bcm_chars_in_buffer (struct tty_struct *tty);
166 +static void bcm_flush_buffer (struct tty_struct *tty);
167 +static void bcm_throttle (struct tty_struct *tty);
168 +static void bcm_unthrottle (struct tty_struct *tty);
169 +static void bcm_send_xchar (struct tty_struct *tty, char ch);
170 +static int get_serial_info(struct bcm_serial *info, struct serial_struct *retinfo);
171 +static int set_serial_info (struct bcm_serial *info, struct serial_struct *new_info);
172 +static int get_lsr_info (struct bcm_serial *info, unsigned int *value);
173 +static void send_break (struct bcm_serial *info, int duration);
174 +static int bcm_ioctl (struct tty_struct * tty, struct file * file,
175 + unsigned int cmd, unsigned long arg);
176 +static void bcm_set_termios (struct tty_struct *tty, struct termios *old_termios);
177 +static void bcm63xx_cons_close (struct tty_struct *tty, struct file *filp);
178 +static void bcm_hangup (struct tty_struct *tty);
179 +static int block_til_ready (struct tty_struct *tty, struct file *filp, struct bcm_serial *info);
180 +static int bcm63xx_cons_open (struct tty_struct * tty, struct file * filp);
181 +static int __init bcm63xx_serialinit(void);
185 + * ------------------------------------------------------------
186 + * rs_stop () and rs_start ()
188 + * These routines are called before setting or resetting
189 + * tty->stopped. They enable or disable transmitter interrupts,
191 + * ------------------------------------------------------------
193 +static void bcm_stop (struct tty_struct *tty)
197 +static void bcm_start (struct tty_struct *tty)
199 + _puts(CARDNAME " Start\n");
203 + * ------------------------------------------------------------
206 + * This routine deals with inputs from any lines.
207 + * ------------------------------------------------------------
209 +static inline void receive_chars (struct bcm_serial * info)
211 + struct tty_struct *tty = 0;
212 + struct async_icount * icount;
214 + unsigned short status, tmp;
216 + while ((status = info->port->intStatus) & RXINT)
218 + char flag_char = 0;
220 + if (status & RXFIFONE)
221 + ch = info->port->Data; // Read the character
222 + tty = info->tty; /* now tty points to the proper dev */
223 + icount = &info->icount;
226 + if (!tty_buffer_request_room(tty, 1))
229 + if (status & RXBRK)
231 + flag_char = TTY_BREAK;
234 + // keep track of the statistics
235 + if (status & (RXFRAMERR | RXPARERR | RXOVFERR))
237 + if (status & RXPARERR) /* parity error */
240 + if (status & RXFRAMERR) /* frame error */
242 + if (status & RXOVFERR)
244 + // Overflow. Reset the RX FIFO
245 + info->port->fifoctl |= RSTRXFIFOS;
248 + // check to see if we should ignore the character
249 + // and mask off conditions that should be ignored
250 + if (status & info->ignore_status_mask)
252 + if (++ignore > 100 )
256 + // Mask off the error conditions we want to ignore
257 + tmp = status & info->read_status_mask;
258 + if (tmp & RXPARERR)
260 + flag_char = TTY_PARITY;
263 + if (tmp & RXFRAMERR)
265 + flag_char = TTY_FRAME;
267 + if (tmp & RXOVFERR)
269 + tty_insert_flip_char(tty, ch, flag_char);
271 + flag_char = TTY_OVERRUN;
272 + if (!tty_buffer_request_room(tty, 1))
276 + tty_insert_flip_char(tty, ch, flag_char);
280 + tty_flip_buffer_push(tty);
285 + * ------------------------------------------------------------
288 + * this is the main interrupt routine for the chip.
289 + * It deals with the multiple ports.
290 + * ------------------------------------------------------------
292 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
293 +static irqreturn_t bcm_interrupt (int irq, void * dev, struct pt_regs * regs)
295 +static void bcm_interrupt (int irq, void * dev, struct pt_regs * regs)
298 + struct bcm_serial * info = lines[0];
301 + /* get pending interrupt flags from UART */
303 + /* Mask with only the serial interrupts that are enabled */
304 + intStat = info->port->intStatus & info->port->intMask;
307 + if (intStat & RXINT)
308 + receive_chars (info);
310 + if (intStat & TXINT)
311 + info->port->intStatus = TXINT;
312 + else /* don't know what it was, so let's mask it */
313 + info->port->intMask &= ~intStat;
315 + intStat = info->port->intStatus & info->port->intMask;
318 + // Clear the interrupt
319 + BcmHalInterruptEnable (INTERRUPT_ID_UART);
320 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
321 + return IRQ_HANDLED;
326 + * -------------------------------------------------------------------
329 + * various initialization tasks
330 + * -------------------------------------------------------------------
332 +static int startup (struct bcm_serial *info)
334 + // Port is already started...
339 + * -------------------------------------------------------------------
342 + * This routine will shutdown a serial port; interrupts are disabled, and
343 + * DTR is dropped if the hangup on close termio flag is on.
344 + * -------------------------------------------------------------------
346 +static void shutdown (struct bcm_serial * info)
348 + unsigned long flags;
349 + if (!info->is_initialized)
352 + save_flags (flags);
355 + info->port->control &= ~(BRGEN|TXEN|RXEN);
357 + set_bit (TTY_IO_ERROR, &info->tty->flags);
358 + info->is_initialized = 0;
360 + restore_flags (flags);
363 + * -------------------------------------------------------------------
366 + * Set the baud rate, character size, parity and stop bits.
367 + * -------------------------------------------------------------------
369 +static void change_speed( volatile Uart *pUart, tcflag_t cFlag )
371 + unsigned long ulFlags, ulBaud, ulClockFreqHz, ulTmp;
372 + save_flags(ulFlags);
374 + switch( cFlag & (CBAUD | CBAUDEX) )
432 + /* Calculate buad rate. */
433 + ulClockFreqHz = BD_BCM63XX_TIMER_CLOCK_INPUT;
434 + ulTmp = (ulClockFreqHz / ulBaud) / 16;
436 + ulTmp /= 2; /* Rounding up, so sub is already accounted for */
438 + ulTmp = (ulTmp / 2) - 1; /* Rounding down so we must sub 1 */
439 + pUart->baudword = ulTmp;
441 + /* Set character size, stop bits and parity. */
442 + switch( cFlag & CSIZE )
445 + ulTmp = BITS5SYM; /* select transmit 5 bit data size */
448 + ulTmp = BITS6SYM; /* select transmit 6 bit data size */
451 + ulTmp = BITS7SYM; /* select transmit 7 bit data size */
455 + ulTmp = BITS8SYM; /* select transmit 8 bit data size */
458 + if( cFlag & CSTOPB )
459 + ulTmp |= TWOSTOP; /* select 2 stop bits */
461 + ulTmp |= ONESTOP; /* select one stop bit */
463 + /* Write these values into the config reg. */
464 + pUart->config = ulTmp;
465 + pUart->control &= ~(RXPARITYEN | TXPARITYEN | RXPARITYEVEN | TXPARITYEVEN);
466 + switch( cFlag & (PARENB | PARODD) )
468 + case PARENB|PARODD:
469 + pUart->control |= RXPARITYEN | TXPARITYEN;
472 + pUart->control |= RXPARITYEN | TXPARITYEN | RXPARITYEVEN | TXPARITYEVEN;
475 + pUart->control |= 0;
479 + /* Reset and flush uart */
480 + pUart->fifoctl = RSTTXFIFOS | RSTRXFIFOS;
481 + restore_flags( ulFlags );
486 + * -------------------------------------------------------------------
487 + * bcm_flush_char ()
489 + * Nothing to flush. Polled I/O is used.
490 + * -------------------------------------------------------------------
492 +static void bcm63xx_cons_flush_chars (struct tty_struct *tty)
498 + * -------------------------------------------------------------------
499 + * bcm63xx_cons_write ()
501 + * Main output routine using polled I/O.
502 + * -------------------------------------------------------------------
504 +static int bcm63xx_cons_write (struct tty_struct *tty, int from_user,
505 + const unsigned char *buf, int count)
509 + for (c = 0; c < count; c++)
515 + * -------------------------------------------------------------------
516 + * bcm63xx_cons_write_room ()
518 + * Compute the amount of space available for writing.
519 + * -------------------------------------------------------------------
521 +static int bcm63xx_cons_write_room (struct tty_struct *tty)
523 + /* Pick a number. Any number. Polled I/O is used. */
528 + * -------------------------------------------------------------------
529 + * bcm_chars_in_buffer ()
531 + * compute the amount of char left to be transmitted
532 + * -------------------------------------------------------------------
534 +static int bcm_chars_in_buffer (struct tty_struct *tty)
540 + * -------------------------------------------------------------------
541 + * bcm_flush_buffer ()
543 + * Empty the output buffer
544 + * -------------------------------------------------------------------
546 +static void bcm_flush_buffer (struct tty_struct *tty)
551 + * ------------------------------------------------------------
552 + * bcm_throttle () and bcm_unthrottle ()
554 + * This routine is called by the upper-layer tty layer to signal that
555 + * incoming characters should be throttled (or not).
556 + * ------------------------------------------------------------
558 +static void bcm_throttle (struct tty_struct *tty)
560 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
562 + info->x_char = STOP_CHAR(tty);
565 +static void bcm_unthrottle (struct tty_struct *tty)
567 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
573 + info->x_char = START_CHAR(tty);
577 +static void bcm_send_xchar (struct tty_struct *tty, char ch)
579 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
582 + bcm_start (info->tty);
586 + * ------------------------------------------------------------
587 + * rs_ioctl () and friends
588 + * ------------------------------------------------------------
590 +static int get_serial_info(struct bcm_serial *info, struct serial_struct *retinfo)
592 + struct serial_struct tmp;
597 + memset (&tmp, 0, sizeof(tmp));
598 + tmp.type = info->type;
599 + tmp.line = info->line;
600 + tmp.port = (int) info->port;
601 + tmp.irq = info->irq;
603 + tmp.baud_base = info->baud_base;
604 + tmp.close_delay = info->close_delay;
605 + tmp.closing_wait = info->closing_wait;
607 + return copy_to_user (retinfo, &tmp, sizeof(*retinfo));
610 +static int set_serial_info (struct bcm_serial *info, struct serial_struct *new_info)
612 + struct serial_struct new_serial;
613 + struct bcm_serial old_info;
619 + copy_from_user (&new_serial, new_info, sizeof(new_serial));
622 + if (!capable(CAP_SYS_ADMIN))
626 + if (info->count > 1)
629 + /* OK, past this point, all the error checking has been done.
630 + * At this point, we start making changes.....
632 + info->baud_base = new_serial.baud_base;
633 + info->type = new_serial.type;
634 + info->close_delay = new_serial.close_delay;
635 + info->closing_wait = new_serial.closing_wait;
636 + retval = startup (info);
641 + * get_lsr_info - get line status register info
643 + * Purpose: Let user call ioctl() to get info when the UART physically
644 + * is emptied. On bus types like RS485, the transmitter must
645 + * release the bus after transmitting. This must be done when
646 + * the transmit shift register is empty, not be done when the
647 + * transmit holding register is empty. This functionality
648 + * allows an RS485 driver to be written in user space.
650 +static int get_lsr_info (struct bcm_serial *info, unsigned int *value)
656 + * This routine sends a break character out the serial port.
658 +static void send_break (struct bcm_serial *info, int duration)
660 + unsigned long flags;
665 + current->state = TASK_INTERRUPTIBLE;
667 + save_flags (flags);
670 + info->port->control |= XMITBREAK;
671 + schedule_timeout(duration);
672 + info->port->control &= ~XMITBREAK;
674 + restore_flags (flags);
677 +static int bcm_ioctl (struct tty_struct * tty, struct file * file,
678 + unsigned int cmd, unsigned long arg)
681 + struct bcm_serial * info = (struct bcm_serial *)tty->driver_data;
684 + if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
685 + (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
686 + (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT))
688 + if (tty->flags & (1 << TTY_IO_ERROR))
694 + case TCSBRK: /* SVID version: non-zero arg --> no break */
695 + retval = tty_check_change (tty);
698 + tty_wait_until_sent (tty, 0);
700 + send_break (info, HZ/4); /* 1/4 second */
703 + case TCSBRKP: /* support for POSIX tcsendbreak() */
704 + retval = tty_check_change (tty);
707 + tty_wait_until_sent (tty, 0);
708 + send_break (info, arg ? arg*(HZ/10) : HZ/4);
712 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(long));
717 + put_user (C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
722 + error = get_user (arg, (unsigned long *)arg);
725 + tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
729 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(struct serial_struct));
733 + return get_serial_info (info, (struct serial_struct *)arg);
736 + return set_serial_info (info, (struct serial_struct *) arg);
738 + case TIOCSERGETLSR: /* Get line status register */
739 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(unsigned int));
743 + return get_lsr_info (info, (unsigned int *)arg);
745 + case TIOCSERGSTRUCT:
746 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(struct bcm_serial));
751 + copy_to_user((struct bcm_serial *)arg, info, sizeof(struct bcm_serial));
756 + return -ENOIOCTLCMD;
761 +static void bcm_set_termios (struct tty_struct *tty, struct termios *old_termios)
763 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
765 + if( tty->termios->c_cflag != old_termios->c_cflag )
766 + change_speed (info->port, tty->termios->c_cflag);
770 + * ------------------------------------------------------------
771 + * bcm63xx_cons_close()
773 + * This routine is called when the serial port gets closed. First, we
774 + * wait for the last remaining data to be sent. Then, we turn off
775 + * the transmit enable and receive enable flags.
776 + * ------------------------------------------------------------
778 +static void bcm63xx_cons_close (struct tty_struct *tty, struct file *filp)
780 + struct bcm_serial * info = (struct bcm_serial *)tty->driver_data;
781 + unsigned long flags;
786 + save_flags (flags);
789 + if (tty_hung_up_p (filp))
791 + restore_flags (flags);
795 + if ((tty->count == 1) && (info->count != 1))
798 + /* Uh, oh. tty->count is 1, which means that the tty
799 + * structure will be freed. Info->count should always
800 + * be one in these conditions. If it's greater than
801 + * one, we've got real problems, since it means the
802 + * serial port won't be shutdown.
804 + printk("bcm63xx_cons_close: bad serial port count; tty->count is 1, "
805 + "info->count is %d\n", info->count);
809 + if (--info->count < 0)
811 + printk("ds_close: bad serial port count for ttys%d: %d\n",
812 + info->line, info->count);
818 + restore_flags (flags);
822 + /* Now we wait for the transmit buffer to clear; and we notify
823 + * the line discipline to only process XON/XOFF characters.
827 + /* At this point we stop accepting input. To do this, we
828 + * disable the receive line status interrupts.
831 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
832 + if (tty->driver->flush_buffer)
833 + tty->driver->flush_buffer (tty);
835 + if (tty->driver.flush_buffer)
836 + tty->driver.flush_buffer (tty);
838 + if (tty->ldisc.flush_buffer)
839 + tty->ldisc.flush_buffer (tty);
844 + if (tty->ldisc.num != tty_ldisc_get(N_TTY)->num)
846 + if (tty->ldisc.close)
847 + (tty->ldisc.close)(tty);
848 + tty->ldisc = *tty_ldisc_get(N_TTY);
849 + tty->termios->c_line = N_TTY;
850 + if (tty->ldisc.open)
851 + (tty->ldisc.open)(tty);
853 + if (info->blocked_open)
855 + if (info->close_delay)
857 + current->state = TASK_INTERRUPTIBLE;
858 + schedule_timeout(info->close_delay);
860 + wake_up_interruptible (&info->open_wait);
862 + wake_up_interruptible (&info->close_wait);
864 + restore_flags (flags);
868 + * bcm_hangup () --- called by tty_hangup() when a hangup is signaled.
870 +static void bcm_hangup (struct tty_struct *tty)
873 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
879 + wake_up_interruptible (&info->open_wait);
883 + * ------------------------------------------------------------
884 + * rs_open() and friends
885 + * ------------------------------------------------------------
887 +static int block_til_ready (struct tty_struct *tty, struct file *filp,
888 + struct bcm_serial *info)
894 + * This routine is called whenever a serial port is opened. It
895 + * enables interrupts for a serial port. It also performs the
896 + * serial-specific initialization for the tty structure.
898 +static int bcm63xx_cons_open (struct tty_struct * tty, struct file * filp)
900 + struct bcm_serial *info;
903 + // Make sure we're only opening on of the ports we support
904 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
905 + line = MINOR(tty->driver->cdev.dev) - tty->driver->minor_start;
907 + line = MINOR(tty->device) - tty->driver.minor_start;
910 + if ((line < 0) || (line >= BCM_NUM_UARTS))
913 + info = lines[line];
915 + info->port->intMask = 0; /* Clear any pending interrupts */
916 + info->port->intMask = RXINT; /* Enable RX */
919 + tty->driver_data = info;
921 + BcmHalInterruptEnable (INTERRUPT_ID_UART);
923 + // Start up serial port
924 + retval = startup (info);
928 + retval = block_til_ready (tty, filp, info);
933 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
934 + info->pgrp = process_group(current);
935 + info->session = current->signal->session;
937 + info->session = current->session;
938 + info->pgrp = current->pgrp;
944 +/* --------------------------------------------------------------------------
945 + Name: bcm63xx_serialinit
946 + Purpose: Initialize our BCM63xx serial driver
947 +-------------------------------------------------------------------------- */
948 +static int __init bcm63xx_serialinit(void)
951 + struct bcm_serial * info;
953 + // Print the driver version information
956 + memset(&serial_driver, 0, sizeof(struct tty_driver));
957 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
958 + serial_driver.owner = THIS_MODULE;
959 + serial_driver.devfs_name = "tts/";
961 + serial_driver.magic = TTY_DRIVER_MAGIC;
962 + serial_driver.name = "ttyS";
963 + serial_driver.major = TTY_MAJOR;
964 + serial_driver.minor_start = 64;
965 + serial_driver.num = BCM_NUM_UARTS;
966 + serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
967 + serial_driver.subtype = SERIAL_TYPE_NORMAL;
968 + serial_driver.init_termios = tty_std_termios;
969 + serial_driver.init_termios.c_cflag = B115200 | CS8 | CREAD | CLOCAL;
970 + serial_driver.flags = TTY_DRIVER_REAL_RAW;
971 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
972 + serial_driver.refcount = serial_refcount;
973 + serial_driver.ttys = serial_table;
975 + serial_driver.refcount = &serial_refcount;
976 + serial_driver.table = serial_table;
979 + serial_driver.termios = serial_termios;
980 + serial_driver.termios_locked = serial_termios_locked;
981 + serial_driver.open = bcm63xx_cons_open;
982 + serial_driver.close = bcm63xx_cons_close;
983 + serial_driver.write = bcm63xx_cons_write;
984 + serial_driver.flush_chars = bcm63xx_cons_flush_chars;
985 + serial_driver.write_room = bcm63xx_cons_write_room;
986 + serial_driver.chars_in_buffer = bcm_chars_in_buffer;
987 + serial_driver.flush_buffer = bcm_flush_buffer;
988 + serial_driver.ioctl = bcm_ioctl;
989 + serial_driver.throttle = bcm_throttle;
990 + serial_driver.unthrottle = bcm_unthrottle;
991 + serial_driver.send_xchar = bcm_send_xchar;
992 + serial_driver.set_termios = bcm_set_termios;
993 + serial_driver.stop = bcm_stop;
994 + serial_driver.start = bcm_start;
995 + serial_driver.hangup = bcm_hangup;
997 + if (tty_register_driver (&serial_driver))
998 + panic("Couldn't register serial driver\n");
1000 + save_flags(flags); cli();
1001 + for (i = 0; i < BCM_NUM_UARTS; i++)
1005 + info->port = (Uart *) ((char *)UART_BASE + (i * 0x20));
1006 + info->irq = (2 - i) + 8;
1009 + info->close_delay = 50;
1010 + info->closing_wait = 3000;
1014 + info->blocked_open = 0;
1015 + info->normal_termios = serial_driver.init_termios;
1016 + init_waitqueue_head(&info->open_wait);
1017 + init_waitqueue_head(&info->close_wait);
1019 + /* If we are pointing to address zero then punt - not correctly
1020 + * set up in setup.c to handle this.
1024 + BcmHalMapInterrupt(bcm_interrupt, 0, INTERRUPT_ID_UART);
1027 + /* order matters here... the trick is that flags
1028 + * is updated... in request_irq - to immediatedly obliterate
1031 + restore_flags(flags);
1035 +module_init(bcm63xx_serialinit);
1037 +/* --------------------------------------------------------------------------
1038 + Name: bcm_console_print
1039 + Purpose: bcm_console_print is registered for printk.
1040 + The console_lock must be held when we get here.
1041 +-------------------------------------------------------------------------- */
1042 +static void bcm_console_print (struct console * cons, const char * str,
1043 + unsigned int count)
1047 + for(i=0; i<count; i++, str++)
1057 +static struct tty_driver * bcm_console_device(struct console * c, int *index)
1059 + *index = c->index;
1060 + return &serial_driver;
1063 +static int __init bcm_console_setup(struct console * co, char * options)
1068 +static struct console bcm_sercons = {
1070 + .write = bcm_console_print,
1071 + .device = bcm_console_device,
1072 + .setup = bcm_console_setup,
1073 + .flags = CON_PRINTBUFFER, // CON_CONSDEV, CONSOLE_LINE,
1077 +static int __init bcm63xx_console_init(void)
1079 + register_console(&bcm_sercons);
1083 +console_initcall(bcm63xx_console_init);
1084 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6338_intr.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6338_intr.h
1085 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6338_intr.h 1970-01-01 01:00:00.000000000 +0100
1086 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6338_intr.h 2006-07-05 15:21:58.000000000 +0200
1090 + Copyright 2003 Broadcom Corp. All Rights Reserved.
1092 + This program is free software; you can distribute it and/or modify it
1093 + under the terms of the GNU General Public License (Version 2) as
1094 + published by the Free Software Foundation.
1096 + This program is distributed in the hope it will be useful, but WITHOUT
1097 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1098 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1101 + You should have received a copy of the GNU General Public License along
1102 + with this program; if not, write to the Free Software Foundation, Inc.,
1103 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1107 +#ifndef __6338_INTR_H
1108 +#define __6338_INTR_H
1114 +/*=====================================================================*/
1115 +/* BCM6338 External Interrupt Level Assignments */
1116 +/*=====================================================================*/
1117 +#define INTERRUPT_ID_EXTERNAL_0 3
1118 +#define INTERRUPT_ID_EXTERNAL_1 4
1119 +#define INTERRUPT_ID_EXTERNAL_2 5
1120 +#define INTERRUPT_ID_EXTERNAL_3 6
1122 +/*=====================================================================*/
1123 +/* BCM6338 Timer Interrupt Level Assignments */
1124 +/*=====================================================================*/
1125 +#define MIPS_TIMER_INT 7
1127 +/*=====================================================================*/
1128 +/* Peripheral ISR Table Offset */
1129 +/*=====================================================================*/
1130 +#define INTERNAL_ISR_TABLE_OFFSET 8
1132 +/*=====================================================================*/
1133 +/* Logical Peripheral Interrupt IDs */
1134 +/*=====================================================================*/
1136 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
1137 +#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
1138 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
1139 +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 4)
1140 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 5)
1141 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 6)
1142 +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 7)
1143 +#define INTERRUPT_ID_EMAC1 (INTERNAL_ISR_TABLE_OFFSET + 8)
1144 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 9)
1145 +#define INTERRUPT_ID_SDRAM (INTERNAL_ISR_TABLE_OFFSET + 10)
1146 +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 11)
1147 +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 12)
1148 +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 13)
1149 +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 14)
1150 +#define INTERRUPT_ID_EMAC1_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 15)
1151 +#define INTERRUPT_ID_EMAC1_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 16)
1152 +#define INTERRUPT_ID_SDIO (INTERNAL_ISR_TABLE_OFFSET + 17)
1158 +#endif /* __BCM6338_H */
1160 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6338_map_part.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6338_map_part.h
1161 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6338_map_part.h 1970-01-01 01:00:00.000000000 +0100
1162 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6338_map_part.h 2006-07-05 15:21:58.000000000 +0200
1166 + Copyright 2004 Broadcom Corp. All Rights Reserved.
1168 + This program is free software; you can distribute it and/or modify it
1169 + under the terms of the GNU General Public License (Version 2) as
1170 + published by the Free Software Foundation.
1172 + This program is distributed in the hope it will be useful, but WITHOUT
1173 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1174 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1177 + You should have received a copy of the GNU General Public License along
1178 + with this program; if not, write to the Free Software Foundation, Inc.,
1179 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1183 +#ifndef __BCM6338_MAP_H
1184 +#define __BCM6338_MAP_H
1190 +#include "bcmtypes.h"
1192 +#define PERF_BASE 0xfffe0000
1193 +#define TIMR_BASE 0xfffe0200
1194 +#define UART_BASE 0xfffe0300
1195 +#define GPIO_BASE 0xfffe0400
1196 +#define SPI_BASE 0xfffe0c00
1198 +typedef struct PerfControl {
1200 + uint16 testControl;
1201 + uint16 blkEnables;
1202 +#define EMAC_CLK_EN 0x0010
1203 +#define USBS_CLK_EN 0x0010
1204 +#define SAR_CLK_EN 0x0020
1206 +#define SPI_CLK_EN 0x0200
1208 + uint32 pll_control;
1209 +#define SOFT_RESET 0x00000001
1215 +#define EI_SENSE_SHFT 0
1216 +#define EI_STATUS_SHFT 5
1217 +#define EI_CLEAR_SHFT 10
1218 +#define EI_MASK_SHFT 15
1219 +#define EI_INSENS_SHFT 20
1220 +#define EI_LEVEL_SHFT 25
1222 + uint32 unused[4]; /* (18) */
1223 + uint32 BlockSoftReset; /* (28) */
1224 +#define BSR_SPI 0x00000001
1225 +#define BSR_EMAC 0x00000004
1226 +#define BSR_USBH 0x00000008
1227 +#define BSR_USBS 0x00000010
1228 +#define BSR_ADSL 0x00000020
1229 +#define BSR_DMAMEM 0x00000040
1230 +#define BSR_SAR 0x00000080
1231 +#define BSR_ACLC 0x00000100
1232 +#define BSR_ADSL_MIPS_PLL 0x00000400
1233 +#define BSR_ALL_BLOCKS \
1234 + (BSR_SPI | BSR_EMAC | BSR_USBH | BSR_USBS | BSR_ADSL | BSR_DMAMEM | \
1235 + BSR_SAR | BSR_ACLC | BSR_ADSL_MIPS_PLL)
1238 +#define PERF ((volatile PerfControl * const) PERF_BASE)
1241 +typedef struct Timer {
1244 +#define TIMER0EN 0x01
1245 +#define TIMER1EN 0x02
1246 +#define TIMER2EN 0x04
1248 +#define TIMER0 0x01
1249 +#define TIMER1 0x02
1250 +#define TIMER2 0x04
1251 +#define WATCHDOG 0x08
1255 +#define TIMERENABLE 0x80000000
1256 +#define RSTCNTCLR 0x40000000
1260 + uint32 WatchDogDefCount;
1262 + /* Write 0xff00 0x00ff to Start timer
1263 + * Write 0xee00 0x00ee to Stop and re-load default count
1264 + * Read from this register returns current watch dog count
1266 + uint32 WatchDogCtl;
1268 + /* Number of 40-MHz ticks for WD Reset pulse to last */
1269 + uint32 WDResetCount;
1272 +#define TIMER ((volatile Timer * const) TIMR_BASE)
1273 +typedef struct UartChannel {
1276 +#define BRGEN 0x80 /* Control register bit defs */
1279 +#define LOOPBK 0x10
1280 +#define TXPARITYEN 0x08
1281 +#define TXPARITYEVEN 0x04
1282 +#define RXPARITYEN 0x02
1283 +#define RXPARITYEVEN 0x01
1286 +#define XMITBREAK 0x40
1287 +#define BITS5SYM 0x00
1288 +#define BITS6SYM 0x10
1289 +#define BITS7SYM 0x20
1290 +#define BITS8SYM 0x30
1291 +#define ONESTOP 0x07
1292 +#define TWOSTOP 0x0f
1293 + /* 4-LSBS represent STOP bits/char
1294 + * in 1/8 bit-time intervals. Zero
1295 + * represents 1/8 stop bit interval.
1296 + * Fifteen represents 2 stop bits.
1299 +#define RSTTXFIFOS 0x80
1300 +#define RSTRXFIFOS 0x40
1301 + /* 5-bit TimeoutCnt is in low bits of this register.
1302 + * This count represents the number of characters
1303 + * idle times before setting receive Irq when below threshold
1306 + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
1309 + byte txf_levl; /* Read-only fifo depth */
1310 + byte rxf_levl; /* Read-only fifo depth */
1311 + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
1312 + * RxThreshold. Irq can be asserted
1313 + * when rx fifo> thresh, txfifo<thresh
1315 + byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
1316 + * if these bits are also enabled to GPIO_o
1322 + byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
1323 + * detect irq on rising AND falling
1324 + * edges for corresponding GPIO_i
1325 + * if enabled (edge insensitive)
1327 + byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
1328 + * 0 for negedge sense if
1329 + * not configured for edge
1330 + * insensitive (see above)
1331 + * Lower 4 bits: Mask to enable change
1332 + * detection IRQ for corresponding
1335 + byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
1336 + * have changed (may set IRQ).
1337 + * read automatically clears bit
1338 + * Lower 4 bits are actual status
1341 + uint16 intMask; /* Same Bit defs for Mask and status */
1343 +#define DELTAIP 0x0001
1344 +#define TXUNDERR 0x0002
1345 +#define TXOVFERR 0x0004
1346 +#define TXFIFOTHOLD 0x0008
1347 +#define TXREADLATCH 0x0010
1348 +#define TXFIFOEMT 0x0020
1349 +#define RXUNDERR 0x0040
1350 +#define RXOVFERR 0x0080
1351 +#define RXTIMEOUT 0x0100
1352 +#define RXFIFOFULL 0x0200
1353 +#define RXFIFOTHOLD 0x0400
1354 +#define RXFIFONE 0x0800
1355 +#define RXFRAMERR 0x1000
1356 +#define RXPARERR 0x2000
1357 +#define RXBRK 0x4000
1360 + uint16 Data; /* Write to TX, Read from RX */
1361 + /* bits 11:8 are BRK,PAR,FRM errors */
1367 +#define UART ((volatile Uart * const) UART_BASE)
1369 +typedef struct GpioControl {
1371 + uint32 GPIODir; /* bits 7:0 */
1373 + uint32 GPIOio; /* bits 7:0 */
1375 +#define LED3_STROBE 0x08000000
1376 +#define LED2_STROBE 0x04000000
1377 +#define LED1_STROBE 0x02000000
1378 +#define LED0_STROBE 0x01000000
1379 +#define LED_TEST 0x00010000
1380 +#define LED3_DISABLE_LINK_ACT 0x00008000
1381 +#define LED2_DISABLE_LINK_ACT 0x00004000
1382 +#define LED1_DISABLE_LINK_ACT 0x00002000
1383 +#define LED0_DISABLE_LINK_ACT 0x00001000
1384 +#define LED_INTERVAL_SET_MASK 0x00000f00
1385 +#define LED_INTERVAL_SET_320MS 0x00000500
1386 +#define LED_INTERVAL_SET_160MS 0x00000400
1387 +#define LED_INTERVAL_SET_80MS 0x00000300
1388 +#define LED_INTERVAL_SET_40MS 0x00000200
1389 +#define LED_INTERVAL_SET_20MS 0x00000100
1390 +#define LED3_ON 0x00000080
1391 +#define LED2_ON 0x00000040
1392 +#define LED1_ON 0x00000020
1393 +#define LED0_ON 0x00000010
1394 +#define LED3_ENABLE 0x00000008
1395 +#define LED2_ENABLE 0x00000004
1396 +#define LED1_ENABLE 0x00000002
1397 +#define LED0_ENABLE 0x00000001
1398 + uint32 SpiSlaveCfg;
1399 +#define SPI_SLAVE_RESET 0x00010000
1400 +#define SPI_RESTRICT 0x00000400
1401 +#define SPI_DELAY_DISABLE 0x00000200
1402 +#define SPI_PROBE_MUX_SEL_MASK 0x000001e0
1403 +#define SPI_SER_ADDR_CFG_MASK 0x0000000c
1404 +#define SPI_MODE 0x00000001
1405 + uint32 vRegConfig;
1408 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
1410 +/* Number to mask conversion macro used for GPIODir and GPIOio */
1411 +#define GPIO_NUM_MAX_BITS_MASK 0x0f
1412 +#define GPIO_NUM_TO_MASK(X) (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
1418 +typedef struct SpiControl {
1419 + uint16 spiCmd; /* (0x0): SPI command */
1420 +#define SPI_CMD_START_IMMEDIATE 3
1422 +#define SPI_CMD_COMMAND_SHIFT 0
1423 +#define SPI_CMD_DEVICE_ID_SHIFT 4
1424 +#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
1426 + byte spiIntStatus; /* (0x2): SPI interrupt status */
1427 + byte spiMaskIntStatus; /* (0x3): SPI masked interrupt status */
1429 + byte spiIntMask; /* (0x4): SPI interrupt mask */
1430 +#define SPI_INTR_CMD_DONE 0x01
1431 +#define SPI_INTR_CLEAR_ALL 0x1f
1433 + byte spiStatus; /* (0x5): SPI status */
1435 + byte spiClkCfg; /* (0x6): SPI clock configuration */
1437 + byte spiFillByte; /* (0x7): SPI fill byte */
1440 + byte spiMsgTail; /* (0x9): msgtail */
1442 + byte spiRxTail; /* (0xB): rxtail */
1444 + uint32 unused2[13]; /* (0x0c - 0x3c) reserved */
1446 + byte spiMsgCtl; /* (0x40) control byte */
1447 +#define HALF_DUPLEX_W 1
1448 +#define HALF_DUPLEX_R 2
1449 +#define SPI_MSG_TYPE_SHIFT 6
1450 +#define SPI_BYTE_CNT_SHIFT 0
1451 + byte spiMsgData[63]; /* (0x41 - 0x7f) msg data */
1452 + byte spiRxDataFifo[64]; /* (0x80 - 0xbf) rx data */
1453 + byte unused3[64]; /* (0xc0 - 0xff) reserved */
1456 +#define SPI ((volatile SpiControl * const) SPI_BASE)
1459 +** External Bus Interface
1461 +typedef struct EbiChipSelect {
1462 + uint32 base; /* base address in upper 24 bits */
1463 +#define EBI_SIZE_8K 0
1464 +#define EBI_SIZE_16K 1
1465 +#define EBI_SIZE_32K 2
1466 +#define EBI_SIZE_64K 3
1467 +#define EBI_SIZE_128K 4
1468 +#define EBI_SIZE_256K 5
1469 +#define EBI_SIZE_512K 6
1470 +#define EBI_SIZE_1M 7
1471 +#define EBI_SIZE_2M 8
1472 +#define EBI_SIZE_4M 9
1473 +#define EBI_SIZE_8M 10
1474 +#define EBI_SIZE_16M 11
1475 +#define EBI_SIZE_32M 12
1476 +#define EBI_SIZE_64M 13
1477 +#define EBI_SIZE_128M 14
1478 +#define EBI_SIZE_256M 15
1480 +#define EBI_ENABLE 0x00000001 /* .. enable this range */
1481 +#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
1482 +#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
1483 +#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
1484 +#define EBI_WREN 0x00000020 /* enable posted writes */
1485 +#define EBI_POLARITY 0x00000040 /* .. set to invert something,
1486 + ** don't know what yet */
1487 +#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
1488 +#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
1489 +#define EBI_FIFO 0x00000200 /* .. use fifo */
1490 +#define EBI_RE 0x00000400 /* .. Reverse Endian */
1493 +typedef struct MpiRegisters {
1494 + EbiChipSelect cs[1]; /* size chip select configuration */
1497 +#define MPI ((volatile MpiRegisters * const) MPI_BASE)
1505 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6345_intr.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6345_intr.h
1506 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6345_intr.h 1970-01-01 01:00:00.000000000 +0100
1507 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6345_intr.h 2006-07-05 15:21:58.000000000 +0200
1511 + Copyright 2002 Broadcom Corp. All Rights Reserved.
1513 + This program is free software; you can distribute it and/or modify it
1514 + under the terms of the GNU General Public License (Version 2) as
1515 + published by the Free Software Foundation.
1517 + This program is distributed in the hope it will be useful, but WITHOUT
1518 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1519 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1522 + You should have received a copy of the GNU General Public License along
1523 + with this program; if not, write to the Free Software Foundation, Inc.,
1524 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1528 +#ifndef __6345_INTR_H
1529 +#define __6345_INTR_H
1535 +/*=====================================================================*/
1536 +/* BCM6345 External Interrupt Level Assignments */
1537 +/*=====================================================================*/
1538 +#define INTERRUPT_ID_EXTERNAL_0 3
1539 +#define INTERRUPT_ID_EXTERNAL_1 4
1540 +#define INTERRUPT_ID_EXTERNAL_2 5
1541 +#define INTERRUPT_ID_EXTERNAL_3 6
1543 +/*=====================================================================*/
1544 +/* BCM6345 Timer Interrupt Level Assignments */
1545 +/*=====================================================================*/
1546 +#define MIPS_TIMER_INT 7
1548 +/*=====================================================================*/
1549 +/* Peripheral ISR Table Offset */
1550 +/*=====================================================================*/
1551 +#define INTERNAL_ISR_TABLE_OFFSET 8
1552 +#define DMA_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 13)
1554 +/*=====================================================================*/
1555 +/* Logical Peripheral Interrupt IDs */
1556 +/*=====================================================================*/
1558 +/* Internal peripheral interrupt IDs */
1559 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
1560 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
1561 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 3)
1562 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 4)
1563 +#define INTERRUPT_ID_USB (INTERNAL_ISR_TABLE_OFFSET + 5)
1564 +#define INTERRUPT_ID_EMAC (INTERNAL_ISR_TABLE_OFFSET + 8)
1565 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 12)
1567 +/* DMA channel interrupt IDs */
1568 +#define INTERRUPT_ID_EMAC_RX_CHAN (DMA_ISR_TABLE_OFFSET + EMAC_RX_CHAN)
1569 +#define INTERRUPT_ID_EMAC_TX_CHAN (DMA_ISR_TABLE_OFFSET + EMAC_TX_CHAN)
1570 +#define INTERRUPT_ID_EBI_RX_CHAN (DMA_ISR_TABLE_OFFSET + EBI_RX_CHAN)
1571 +#define INTERRUPT_ID_EBI_TX_CHAN (DMA_ISR_TABLE_OFFSET + EBI_TX_CHAN)
1572 +#define INTERRUPT_ID_RESERVED_RX_CHAN (DMA_ISR_TABLE_OFFSET + RESERVED_RX_CHAN)
1573 +#define INTERRUPT_ID_RESERVED_TX_CHAN (DMA_ISR_TABLE_OFFSET + RESERVED_TX_CHAN)
1574 +#define INTERRUPT_ID_USB_BULK_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_BULK_RX_CHAN)
1575 +#define INTERRUPT_ID_USB_BULK_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_BULK_TX_CHAN)
1576 +#define INTERRUPT_ID_USB_CNTL_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_CNTL_RX_CHAN)
1577 +#define INTERRUPT_ID_USB_CNTL_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_CNTL_TX_CHAN)
1578 +#define INTERRUPT_ID_USB_ISO_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_ISO_RX_CHAN)
1579 +#define INTERRUPT_ID_USB_ISO_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_ISO_TX_CHAN)
1585 +#endif /* __BCM6345_H */
1587 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6345_map_part.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6345_map_part.h
1588 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6345_map_part.h 1970-01-01 01:00:00.000000000 +0100
1589 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6345_map_part.h 2006-07-05 15:21:58.000000000 +0200
1593 + Copyright 2002 Broadcom Corp. All Rights Reserved.
1595 + This program is free software; you can distribute it and/or modify it
1596 + under the terms of the GNU General Public License (Version 2) as
1597 + published by the Free Software Foundation.
1599 + This program is distributed in the hope it will be useful, but WITHOUT
1600 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1601 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1604 + You should have received a copy of the GNU General Public License along
1605 + with this program; if not, write to the Free Software Foundation, Inc.,
1606 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1610 +#ifndef __BCM6345_MAP_H
1611 +#define __BCM6345_MAP_H
1617 +#include "bcmtypes.h"
1618 +#include "6345_intr.h"
1620 +typedef struct IntControl {
1622 + uint16 testControl;
1623 + uint16 blkEnables;
1624 +#define USB_CLK_EN 0x0100
1625 +#define EMAC_CLK_EN 0x0080
1626 +#define UART_CLK_EN 0x0008
1627 +#define CPU_CLK_EN 0x0001
1629 + uint32 pll_control;
1630 +#define SOFT_RESET 0x00000001
1636 +#define EI_SENSE_SHFT 0
1637 +#define EI_STATUS_SHFT 4
1638 +#define EI_CLEAR_SHFT 8
1639 +#define EI_MASK_SHFT 12
1640 +#define EI_INSENS_SHFT 16
1641 +#define EI_LEVEL_SHFT 20
1644 +#define INTC_BASE 0xfffe0000
1645 +#define PERF ((volatile IntControl * const) INTC_BASE)
1647 +#define TIMR_BASE 0xfffe0200
1648 +typedef struct Timer {
1651 +#define TIMER0EN 0x01
1652 +#define TIMER1EN 0x02
1653 +#define TIMER2EN 0x04
1655 +#define TIMER0 0x01
1656 +#define TIMER1 0x02
1657 +#define TIMER2 0x04
1658 +#define WATCHDOG 0x08
1662 +#define TIMERENABLE 0x80000000
1663 +#define RSTCNTCLR 0x40000000
1667 + uint32 WatchDogDefCount;
1669 + /* Write 0xff00 0x00ff to Start timer
1670 + * Write 0xee00 0x00ee to Stop and re-load default count
1671 + * Read from this register returns current watch dog count
1673 + uint32 WatchDogCtl;
1675 + /* Number of 40-MHz ticks for WD Reset pulse to last */
1676 + uint32 WDResetCount;
1679 +#define TIMER ((volatile Timer * const) TIMR_BASE)
1681 +typedef struct UartChannel {
1684 +#define BRGEN 0x80 /* Control register bit defs */
1687 +#define TXPARITYEN 0x08
1688 +#define TXPARITYEVEN 0x04
1689 +#define RXPARITYEN 0x02
1690 +#define RXPARITYEVEN 0x01
1692 +#define BITS5SYM 0x00
1693 +#define BITS6SYM 0x10
1694 +#define BITS7SYM 0x20
1695 +#define BITS8SYM 0x30
1696 +#define XMITBREAK 0x40
1697 +#define ONESTOP 0x07
1698 +#define TWOSTOP 0x0f
1701 +#define RSTTXFIFOS 0x80
1702 +#define RSTRXFIFOS 0x40
1711 + byte DeltaIPEdgeNoSense;
1712 + byte DeltaIPConfig_Mask;
1713 + byte DeltaIP_SyncIP;
1716 +#define TXUNDERR 0x0002
1717 +#define TXOVFERR 0x0004
1718 +#define TXFIFOEMT 0x0020
1719 +#define RXOVFERR 0x0080
1720 +#define RXFIFONE 0x0800
1721 +#define RXFRAMERR 0x1000
1722 +#define RXPARERR 0x2000
1723 +#define RXBRK 0x4000
1731 +#define UART_BASE 0xfffe0300
1732 +#define UART ((volatile Uart * const) UART_BASE)
1734 +typedef struct GpioControl {
1748 +#define GPIO_BASE 0xfffe0400
1749 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
1751 +#define GPIO_NUM_MAX_BITS_MASK 0x0f
1752 +#define GPIO_NUM_TO_MASK(X) (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
1760 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6348_intr.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6348_intr.h
1761 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6348_intr.h 1970-01-01 01:00:00.000000000 +0100
1762 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6348_intr.h 2006-07-05 15:21:58.000000000 +0200
1766 + Copyright 2003 Broadcom Corp. All Rights Reserved.
1768 + This program is free software; you can distribute it and/or modify it
1769 + under the terms of the GNU General Public License (Version 2) as
1770 + published by the Free Software Foundation.
1772 + This program is distributed in the hope it will be useful, but WITHOUT
1773 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1774 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1777 + You should have received a copy of the GNU General Public License along
1778 + with this program; if not, write to the Free Software Foundation, Inc.,
1779 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1783 +#ifndef __6348_INTR_H
1784 +#define __6348_INTR_H
1790 +/*=====================================================================*/
1791 +/* BCM6348 External Interrupt Level Assignments */
1792 +/*=====================================================================*/
1793 +#define INTERRUPT_ID_EXTERNAL_0 3
1794 +#define INTERRUPT_ID_EXTERNAL_1 4
1795 +#define INTERRUPT_ID_EXTERNAL_2 5
1796 +#define INTERRUPT_ID_EXTERNAL_3 6
1798 +/*=====================================================================*/
1799 +/* BCM6348 Timer Interrupt Level Assignments */
1800 +/*=====================================================================*/
1801 +#define MIPS_TIMER_INT 7
1803 +/*=====================================================================*/
1804 +/* Peripheral ISR Table Offset */
1805 +/*=====================================================================*/
1806 +#define INTERNAL_ISR_TABLE_OFFSET 8
1808 +/*=====================================================================*/
1809 +/* Logical Peripheral Interrupt IDs */
1810 +/*=====================================================================*/
1812 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
1813 +#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
1814 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
1815 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 4)
1816 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 5)
1817 +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 6)
1818 +#define INTERRUPT_ID_EMAC2 (INTERNAL_ISR_TABLE_OFFSET + 7)
1819 +#define INTERRUPT_ID_EMAC1 (INTERNAL_ISR_TABLE_OFFSET + 8)
1820 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 9)
1821 +#define INTERRUPT_ID_M2M (INTERNAL_ISR_TABLE_OFFSET + 10)
1822 +#define INTERRUPT_ID_ACLC (INTERNAL_ISR_TABLE_OFFSET + 11)
1823 +#define INTERRUPT_ID_USBH (INTERNAL_ISR_TABLE_OFFSET + 12)
1824 +#define INTERRUPT_ID_SDRAM (INTERNAL_ISR_TABLE_OFFSET + 13)
1825 +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 14)
1826 +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 15)
1827 +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 16)
1828 +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 17)
1829 +#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 18)
1830 +#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 19)
1831 +#define INTERRUPT_ID_EMAC1_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 20)
1832 +#define INTERRUPT_ID_EMAC1_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 21)
1833 +#define INTERRUPT_ID_EMAC2_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 22)
1834 +#define INTERRUPT_ID_EMAC2_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 23)
1835 +#define INTERRUPT_ID_MPI (INTERNAL_ISR_TABLE_OFFSET + 24)
1836 +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 25)
1842 +#endif /* __BCM6348_H */
1844 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6348_map_part.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6348_map_part.h
1845 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/6348_map_part.h 1970-01-01 01:00:00.000000000 +0100
1846 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/6348_map_part.h 2006-07-05 15:21:58.000000000 +0200
1850 + Copyright 2002 Broadcom Corp. All Rights Reserved.
1852 + This program is free software; you can distribute it and/or modify it
1853 + under the terms of the GNU General Public License (Version 2) as
1854 + published by the Free Software Foundation.
1856 + This program is distributed in the hope it will be useful, but WITHOUT
1857 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1858 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1861 + You should have received a copy of the GNU General Public License along
1862 + with this program; if not, write to the Free Software Foundation, Inc.,
1863 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1867 +#ifndef __BCM6348_MAP_H
1868 +#define __BCM6348_MAP_H
1874 +#include "bcmtypes.h"
1876 +#define PERF_BASE 0xfffe0000
1877 +#define TIMR_BASE 0xfffe0200
1878 +#define UART_BASE 0xfffe0300
1879 +#define GPIO_BASE 0xfffe0400
1880 +#define MPI_BASE 0xfffe2000 /* MPI control registers */
1881 +#define USB_HOST_BASE 0xfffe1b00 /* USB host registers */
1882 +#define USB_HOST_NON_OHCI 0xfffe1c00 /* USB host non-OHCI registers */
1884 +typedef struct PerfControl {
1886 + uint16 testControl;
1887 + uint16 blkEnables;
1888 +#define EMAC_CLK_EN 0x0010
1889 +#define SAR_CLK_EN 0x0020
1890 +#define USBS_CLK_EN 0x0040
1891 +#define USBH_CLK_EN 0x0100
1893 + uint32 pll_control;
1894 +#define SOFT_RESET 0x00000001
1900 +#define EI_SENSE_SHFT 0
1901 +#define EI_STATUS_SHFT 5
1902 +#define EI_CLEAR_SHFT 10
1903 +#define EI_MASK_SHFT 15
1904 +#define EI_INSENS_SHFT 20
1905 +#define EI_LEVEL_SHFT 25
1907 + uint32 unused[4]; /* (18) */
1908 + uint32 BlockSoftReset; /* (28) */
1909 +#define BSR_SPI 0x00000001
1910 +#define BSR_EMAC 0x00000004
1911 +#define BSR_USBH 0x00000008
1912 +#define BSR_USBS 0x00000010
1913 +#define BSR_ADSL 0x00000020
1914 +#define BSR_DMAMEM 0x00000040
1915 +#define BSR_SAR 0x00000080
1916 +#define BSR_ACLC 0x00000100
1917 +#define BSR_ADSL_MIPS_PLL 0x00000400
1918 +#define BSR_ALL_BLOCKS \
1919 + (BSR_SPI | BSR_EMAC | BSR_USBH | BSR_USBS | BSR_ADSL | BSR_DMAMEM | \
1920 + BSR_SAR | BSR_ACLC | BSR_ADSL_MIPS_PLL)
1921 + uint32 unused2[2]; /* (2c) */
1922 + uint32 PllStrap; /* (34) */
1923 +#define PLL_N1_SHFT 20
1924 +#define PLL_N1_MASK (7<<PLL_N1_SHFT)
1925 +#define PLL_N2_SHFT 15
1926 +#define PLL_N2_MASK (0x1f<<PLL_N2_SHFT)
1927 +#define PLL_M1_REF_SHFT 12
1928 +#define PLL_M1_REF_MASK (7<<PLL_M1_REF_SHFT)
1929 +#define PLL_M2_REF_SHFT 9
1930 +#define PLL_M2_REF_MASK (7<<PLL_M2_REF_SHFT)
1931 +#define PLL_M1_CPU_SHFT 6
1932 +#define PLL_M1_CPU_MASK (7<<PLL_M1_CPU_SHFT)
1933 +#define PLL_M1_BUS_SHFT 3
1934 +#define PLL_M1_BUS_MASK (7<<PLL_M1_BUS_SHFT)
1935 +#define PLL_M2_BUS_SHFT 0
1936 +#define PLL_M2_BUS_MASK (7<<PLL_M2_BUS_SHFT)
1939 +#define PERF ((volatile PerfControl * const) PERF_BASE)
1941 +typedef struct Timer {
1944 +#define TIMER0EN 0x01
1945 +#define TIMER1EN 0x02
1946 +#define TIMER2EN 0x04
1948 +#define TIMER0 0x01
1949 +#define TIMER1 0x02
1950 +#define TIMER2 0x04
1951 +#define WATCHDOG 0x08
1955 +#define TIMERENABLE 0x80000000
1956 +#define RSTCNTCLR 0x40000000
1960 + uint32 WatchDogDefCount;
1962 + /* Write 0xff00 0x00ff to Start timer
1963 + * Write 0xee00 0x00ee to Stop and re-load default count
1964 + * Read from this register returns current watch dog count
1966 + uint32 WatchDogCtl;
1968 + /* Number of 40-MHz ticks for WD Reset pulse to last */
1969 + uint32 WDResetCount;
1972 +#define TIMER ((volatile Timer * const) TIMR_BASE)
1974 +typedef struct UartChannel {
1977 +#define BRGEN 0x80 /* Control register bit defs */
1980 +#define LOOPBK 0x10
1981 +#define TXPARITYEN 0x08
1982 +#define TXPARITYEVEN 0x04
1983 +#define RXPARITYEN 0x02
1984 +#define RXPARITYEVEN 0x01
1987 +#define XMITBREAK 0x40
1988 +#define BITS5SYM 0x00
1989 +#define BITS6SYM 0x10
1990 +#define BITS7SYM 0x20
1991 +#define BITS8SYM 0x30
1992 +#define ONESTOP 0x07
1993 +#define TWOSTOP 0x0f
1994 + /* 4-LSBS represent STOP bits/char
1995 + * in 1/8 bit-time intervals. Zero
1996 + * represents 1/8 stop bit interval.
1997 + * Fifteen represents 2 stop bits.
2000 +#define RSTTXFIFOS 0x80
2001 +#define RSTRXFIFOS 0x40
2002 + /* 5-bit TimeoutCnt is in low bits of this register.
2003 + * This count represents the number of characters
2004 + * idle times before setting receive Irq when below threshold
2007 + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
2010 + byte txf_levl; /* Read-only fifo depth */
2011 + byte rxf_levl; /* Read-only fifo depth */
2012 + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
2013 + * RxThreshold. Irq can be asserted
2014 + * when rx fifo> thresh, txfifo<thresh
2016 + byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
2017 + * if these bits are also enabled to GPIO_o
2023 + byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
2024 + * detect irq on rising AND falling
2025 + * edges for corresponding GPIO_i
2026 + * if enabled (edge insensitive)
2028 + byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
2029 + * 0 for negedge sense if
2030 + * not configured for edge
2031 + * insensitive (see above)
2032 + * Lower 4 bits: Mask to enable change
2033 + * detection IRQ for corresponding
2036 + byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
2037 + * have changed (may set IRQ).
2038 + * read automatically clears bit
2039 + * Lower 4 bits are actual status
2042 + uint16 intMask; /* Same Bit defs for Mask and status */
2044 +#define DELTAIP 0x0001
2045 +#define TXUNDERR 0x0002
2046 +#define TXOVFERR 0x0004
2047 +#define TXFIFOTHOLD 0x0008
2048 +#define TXREADLATCH 0x0010
2049 +#define TXFIFOEMT 0x0020
2050 +#define RXUNDERR 0x0040
2051 +#define RXOVFERR 0x0080
2052 +#define RXTIMEOUT 0x0100
2053 +#define RXFIFOFULL 0x0200
2054 +#define RXFIFOTHOLD 0x0400
2055 +#define RXFIFONE 0x0800
2056 +#define RXFRAMERR 0x1000
2057 +#define RXPARERR 0x2000
2058 +#define RXBRK 0x4000
2061 + uint16 Data; /* Write to TX, Read from RX */
2062 + /* bits 11:8 are BRK,PAR,FRM errors */
2068 +#define UART ((volatile Uart * const) UART_BASE)
2070 +typedef struct GpioControl {
2071 + uint32 GPIODir_high; /* bits 36:32 */
2072 + uint32 GPIODir; /* bits 31:00 */
2073 + uint32 GPIOio_high; /* bits 36:32 */
2074 + uint32 GPIOio; /* bits 31:00 */
2076 +#define LED3_STROBE 0x08000000
2077 +#define LED2_STROBE 0x04000000
2078 +#define LED1_STROBE 0x02000000
2079 +#define LED0_STROBE 0x01000000
2080 +#define LED_TEST 0x00010000
2081 +#define LED3_DISABLE_LINK_ACT 0x00008000
2082 +#define LED2_DISABLE_LINK_ACT 0x00004000
2083 +#define LED1_DISABLE_LINK_ACT 0x00002000
2084 +#define LED0_DISABLE_LINK_ACT 0x00001000
2085 +#define LED_INTERVAL_SET_MASK 0x00000f00
2086 +#define LED_INTERVAL_SET_320MS 0x00000500
2087 +#define LED_INTERVAL_SET_160MS 0x00000400
2088 +#define LED_INTERVAL_SET_80MS 0x00000300
2089 +#define LED_INTERVAL_SET_40MS 0x00000200
2090 +#define LED_INTERVAL_SET_20MS 0x00000100
2091 +#define LED3_ON 0x00000080
2092 +#define LED2_ON 0x00000040
2093 +#define LED1_ON 0x00000020
2094 +#define LED0_ON 0x00000010
2095 +#define LED3_ENABLE 0x00000008
2096 +#define LED2_ENABLE 0x00000004
2097 +#define LED1_ENABLE 0x00000002
2098 +#define LED0_ENABLE 0x00000001
2099 + uint32 SpiSlaveCfg;
2100 +#define SPI_SLAVE_RESET 0x00010000
2101 +#define SPI_RESTRICT 0x00000400
2102 +#define SPI_DELAY_DISABLE 0x00000200
2103 +#define SPI_PROBE_MUX_SEL_MASK 0x000001e0
2104 +#define SPI_SER_ADDR_CFG_MASK 0x0000000c
2105 +#define SPI_MODE 0x00000001
2107 +#define GROUP4_DIAG 0x00090000
2108 +#define GROUP4_UTOPIA 0x00080000
2109 +#define GROUP4_LEGACY_LED 0x00030000
2110 +#define GROUP4_MII_SNOOP 0x00020000
2111 +#define GROUP4_EXT_EPHY 0x00010000
2112 +#define GROUP3_DIAG 0x00009000
2113 +#define GROUP3_UTOPIA 0x00008000
2114 +#define GROUP3_EXT_MII 0x00007000
2115 +#define GROUP2_DIAG 0x00000900
2116 +#define GROUP2_PCI 0x00000500
2117 +#define GROUP1_DIAG 0x00000090
2118 +#define GROUP1_UTOPIA 0x00000080
2119 +#define GROUP1_SPI_UART 0x00000060
2120 +#define GROUP1_SPI_MASTER 0x00000060
2121 +#define GROUP1_MII_PCCARD 0x00000040
2122 +#define GROUP1_MII_SNOOP 0x00000020
2123 +#define GROUP1_EXT_EPHY 0x00000010
2124 +#define GROUP0_DIAG 0x00000009
2125 +#define GROUP0_EXT_MII 0x00000007
2129 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
2131 +/* Number to mask conversion macro used for GPIODir and GPIOio */
2132 +#define GPIO_NUM_TOTAL_BITS_MASK 0x3f
2133 +#define GPIO_NUM_MAX_BITS_MASK 0x1f
2134 +#define GPIO_NUM_TO_MASK(X) ( (((X) & GPIO_NUM_TOTAL_BITS_MASK) < 32) ? (1 << ((X) & GPIO_NUM_MAX_BITS_MASK)) : (0) )
2136 +/* Number to mask conversion macro used for GPIODir_high and GPIOio_high */
2137 +#define GPIO_NUM_MAX_BITS_MASK_HIGH 0x07
2138 +#define GPIO_NUM_TO_MASK_HIGH(X) ( (((X) & GPIO_NUM_TOTAL_BITS_MASK) >= 32) ? (1 << ((X-32) & GPIO_NUM_MAX_BITS_MASK_HIGH)) : (0) )
2142 +** External Bus Interface
2144 +typedef struct EbiChipSelect {
2145 + uint32 base; /* base address in upper 24 bits */
2146 +#define EBI_SIZE_8K 0
2147 +#define EBI_SIZE_16K 1
2148 +#define EBI_SIZE_32K 2
2149 +#define EBI_SIZE_64K 3
2150 +#define EBI_SIZE_128K 4
2151 +#define EBI_SIZE_256K 5
2152 +#define EBI_SIZE_512K 6
2153 +#define EBI_SIZE_1M 7
2154 +#define EBI_SIZE_2M 8
2155 +#define EBI_SIZE_4M 9
2156 +#define EBI_SIZE_8M 10
2157 +#define EBI_SIZE_16M 11
2158 +#define EBI_SIZE_32M 12
2159 +#define EBI_SIZE_64M 13
2160 +#define EBI_SIZE_128M 14
2161 +#define EBI_SIZE_256M 15
2163 +#define EBI_ENABLE 0x00000001 /* .. enable this range */
2164 +#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
2165 +#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
2166 +#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
2167 +#define EBI_WREN 0x00000020 /* enable posted writes */
2168 +#define EBI_POLARITY 0x00000040 /* .. set to invert something,
2169 + ** don't know what yet */
2170 +#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
2171 +#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
2172 +#define EBI_FIFO 0x00000200 /* .. use fifo */
2173 +#define EBI_RE 0x00000400 /* .. Reverse Endian */
2176 +typedef struct MpiRegisters {
2177 + EbiChipSelect cs[7]; /* size chip select configuration */
2178 +#define EBI_CS0_BASE 0
2179 +#define EBI_CS1_BASE 1
2180 +#define EBI_CS2_BASE 2
2181 +#define EBI_CS3_BASE 3
2182 +#define PCMCIA_COMMON_BASE 4
2183 +#define PCMCIA_ATTRIBUTE_BASE 5
2184 +#define PCMCIA_IO_BASE 6
2185 + uint32 unused0[2]; /* reserved */
2186 + uint32 ebi_control; /* ebi control */
2187 + uint32 unused1[4]; /* reserved */
2188 +#define EBI_ACCESS_TIMEOUT 0x000007FF
2189 + uint32 pcmcia_cntl1; /* pcmcia control 1 */
2190 +#define PCCARD_CARD_RESET 0x00040000
2191 +#define CARDBUS_ENABLE 0x00008000
2192 +#define PCMCIA_ENABLE 0x00004000
2193 +#define PCMCIA_GPIO_ENABLE 0x00002000
2194 +#define CARDBUS_IDSEL 0x00001F00
2195 +#define VS2_OEN 0x00000080
2196 +#define VS1_OEN 0x00000040
2197 +#define VS2_OUT 0x00000020
2198 +#define VS1_OUT 0x00000010
2199 +#define VS2_IN 0x00000008
2200 +#define VS1_IN 0x00000004
2201 +#define CD2_IN 0x00000002
2202 +#define CD1_IN 0x00000001
2203 +#define VS_MASK 0x0000000C
2204 +#define CD_MASK 0x00000003
2205 + uint32 unused2; /* reserved */
2206 + uint32 pcmcia_cntl2; /* pcmcia control 2 */
2207 +#define PCMCIA_BYTESWAP_DIS 0x00000002
2208 +#define PCMCIA_HALFWORD_EN 0x00000001
2209 +#define RW_ACTIVE_CNT_BIT 2
2210 +#define INACTIVE_CNT_BIT 8
2211 +#define CE_SETUP_CNT_BIT 16
2212 +#define CE_HOLD_CNT_BIT 24
2213 + uint32 unused3[40]; /* reserved */
2215 + uint32 sp0range; /* PCI to internal system bus address space */
2224 + uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
2225 +#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
2226 +#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
2227 +#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
2228 +#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
2229 +#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
2230 +#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
2232 + uint32 l2pmrange1; /* internal system bus to PCI memory space */
2233 +#define PCI_SIZE_64K 0xFFFF0000
2234 +#define PCI_SIZE_128K 0xFFFE0000
2235 +#define PCI_SIZE_256K 0xFFFC0000
2236 +#define PCI_SIZE_512K 0xFFF80000
2237 +#define PCI_SIZE_1M 0xFFF00000
2238 +#define PCI_SIZE_2M 0xFFE00000
2239 +#define PCI_SIZE_4M 0xFFC00000
2240 +#define PCI_SIZE_8M 0xFF800000
2241 +#define PCI_SIZE_16M 0xFF000000
2242 +#define PCI_SIZE_32M 0xFE000000
2243 + uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
2244 + uint32 l2pmremap1;
2245 +#define CARDBUS_MEM 0x00000004
2246 +#define MEM_WINDOW_EN 0x00000001
2247 + uint32 l2pmrange2;
2249 + uint32 l2pmremap2;
2250 + uint32 l2piorange; /* internal system bus to PCI I/O space */
2252 + uint32 l2pioremap;
2254 + uint32 pcimodesel;
2255 +#define PCI2_INT_BUS_RD_PREFECH 0x000000F0
2256 +#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
2257 +#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
2259 + uint32 pciintstat; /* PCI interrupt mask/status */
2260 +#define MAILBOX1_SENT 0x08
2261 +#define MAILBOX0_SENT 0x04
2262 +#define MAILBOX1_MSG_RCV 0x02
2263 +#define MAILBOX0_MSG_RCV 0x01
2264 + uint32 locbuscntrl; /* internal system bus control */
2265 +#define DIR_U2P_NOSWAP 0x00000002
2266 +#define EN_PCI_GPIO 0x00000001
2267 + uint32 locintstat; /* internal system bus interrupt mask/status */
2268 +#define CSERR 0x0200
2269 +#define SERR 0x0100
2270 +#define EXT_PCI_INT 0x0080
2271 +#define DIR_FAILED 0x0040
2272 +#define DIR_COMPLETE 0x0020
2273 +#define PCI_CFG 0x0010
2274 + uint32 unused5[7];
2279 + uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
2280 +#define PCI_CFG_REG_WRITE_EN 0x00000080
2281 +#define PCI_CFG_ADDR 0x0000003C
2282 + uint32 pcicfgdata; /* internal system bus PCI configuration data */
2284 + uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
2285 +#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
2286 +#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
2287 +#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
2288 +#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
2289 + uint32 locch2intStat;
2290 +#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
2291 +#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
2292 +#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
2293 + uint32 locch2intMask;
2295 + uint32 locch2descaddr;
2296 + uint32 locch2status1;
2297 +#define LOCAL_DESC_STATE 0xE0000000
2298 +#define PCI_DESC_STATE 0x1C000000
2299 +#define BYTE_DONE 0x03FFC000
2300 +#define RING_ADDR 0x00003FFF
2301 + uint32 locch2status2;
2302 +#define BUFPTR_OFFSET 0x1FFF0000
2303 +#define PCI_MASTER_STATE 0x000000C0
2304 +#define LOC_MASTER_STATE 0x00000038
2305 +#define CONTROL_STATE 0x00000007
2308 + uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
2309 +#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
2310 +#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
2311 + uint32 locch1intstat;
2312 + uint32 locch1intmask;
2314 + uint32 locch1descaddr;
2315 + uint32 locch1status1;
2316 + uint32 locch1status2;
2319 + uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
2320 + uint32 pcich1intstat;
2321 + uint32 pcich1intmask;
2322 + uint32 pcich1descaddr;
2323 + uint32 pcich1status1;
2324 + uint32 pcich1status2;
2326 + uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
2327 + uint32 pcich2intstat;
2328 + uint32 pcich2intmask;
2329 + uint32 pcich2descaddr;
2330 + uint32 pcich2status1;
2331 + uint32 pcich2status2;
2333 + uint32 perm_id; /* permanent device and vendor id */
2334 + uint32 perm_rev; /* permanent revision id */
2337 +#define MPI ((volatile MpiRegisters * const) MPI_BASE)
2339 +/* PCI configuration address space start offset 0x40 */
2340 +#define BRCM_PCI_CONFIG_TIMER 0x40
2341 +#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
2342 +#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
2344 +/* USB host non-Open HCI register, USB_HOST_NON_OHCI, bit definitions. */
2345 +#define NON_OHCI_ENABLE_PORT1 0x00000001 /* Use USB port 1 for host, not dev */
2346 +#define NON_OHCI_BYTE_SWAP 0x00000008 /* Swap USB host registers */
2348 +#define USBH_NON_OHCI ((volatile unsigned long * const) USB_HOST_NON_OHCI)
2356 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcmTag.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcmTag.h
2357 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcmTag.h 1970-01-01 01:00:00.000000000 +0100
2358 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcmTag.h 2006-07-05 15:21:58.000000000 +0200
2362 + Copyright 2002 Broadcom Corp. All Rights Reserved.
2364 + This program is free software; you can distribute it and/or modify it
2365 + under the terms of the GNU General Public License (Version 2) as
2366 + published by the Free Software Foundation.
2368 + This program is distributed in the hope it will be useful, but WITHOUT
2369 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2370 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2373 + You should have received a copy of the GNU General Public License along
2374 + with this program; if not, write to the Free Software Foundation, Inc.,
2375 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2378 +//**************************************************************************************
2379 +// File Name : bcmTag.h
2381 +// Description: add tag with validation system to the firmware image file to be uploaded
2384 +// Created : 02/28/2002 seanl
2385 +//**************************************************************************************
2391 +#define BCM_SIG_1 "Broadcom Corporation"
2392 +#define BCM_SIG_2 "ver. 2.0" // was "firmware version 2.0" now it is split 6 char out for chip id.
2394 +#define BCM_TAG_VER "6"
2395 +#define BCM_TAG_VER_LAST "26"
2397 +// file tag (head) structure all is in clear text except validationTokens (crc, md5, sha1, etc). Total: 128 unsigned chars
2398 +#define TAG_LEN 256
2399 +#define TAG_VER_LEN 4
2401 +#define SIG_LEN_2 14 // Original second SIG = 20 is now devided into 14 for SIG_LEN_2 and 6 for CHIP_ID
2402 +#define CHIP_ID_LEN 6
2403 +#define IMAGE_LEN 10
2404 +#define ADDRESS_LEN 12
2406 +#define TOKEN_LEN 20
2407 +#define BOARD_ID_LEN 16
2408 +#define RESERVED_LEN (TAG_LEN - TAG_VER_LEN - SIG_LEN - SIG_LEN_2 - CHIP_ID_LEN - BOARD_ID_LEN - \
2409 + (4*IMAGE_LEN) - (3*ADDRESS_LEN) - (3*FLAG_LEN) - (2*TOKEN_LEN))
2412 +// TAG for downloadable image (kernel plus file system)
2413 +typedef struct _FILE_TAG
2415 + unsigned char tagVersion[TAG_VER_LEN]; // tag version. Will be 2 here.
2416 + unsigned char signiture_1[SIG_LEN]; // text line for company info
2417 + unsigned char signiture_2[SIG_LEN_2]; // additional info (can be version number)
2418 + unsigned char chipId[CHIP_ID_LEN]; // chip id
2419 + unsigned char boardId[BOARD_ID_LEN]; // board id
2420 + unsigned char bigEndian[FLAG_LEN]; // if = 1 - big, = 0 - little endia of the host
2421 + unsigned char totalImageLen[IMAGE_LEN]; // the sum of all the following length
2422 + unsigned char cfeAddress[ADDRESS_LEN]; // if non zero, cfe starting address
2423 + unsigned char cfeLen[IMAGE_LEN]; // if non zero, cfe size in clear ASCII text.
2424 + unsigned char rootfsAddress[ADDRESS_LEN]; // if non zero, filesystem starting address
2425 + unsigned char rootfsLen[IMAGE_LEN]; // if non zero, filesystem size in clear ASCII text.
2426 + unsigned char kernelAddress[ADDRESS_LEN]; // if non zero, kernel starting address
2427 + unsigned char kernelLen[IMAGE_LEN]; // if non zero, kernel size in clear ASCII text.
2428 + unsigned char dualImage[FLAG_LEN]; // if 1, dual image
2429 + unsigned char inactiveLen[FLAG_LEN]; // if 1, the image is INACTIVE; if 0, active
2430 + unsigned char reserved[RESERVED_LEN]; // reserved for later use
2431 + unsigned char imageValidationToken[TOKEN_LEN];// image validation token - can be crc, md5, sha; for
2432 + // now will be 4 unsigned char crc
2433 + unsigned char tagValidationToken[TOKEN_LEN]; // validation token for tag(from signiture_1 to end of // mageValidationToken)
2434 +} FILE_TAG, *PFILE_TAG;
2436 +#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
2439 +// only included if for bcmTag.exe program
2440 +#ifdef BCMTAG_EXE_USE
2442 +static unsigned long Crc32_table[256] = {
2443 + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
2444 + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
2445 + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
2446 + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
2447 + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
2448 + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
2449 + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
2450 + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
2451 + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
2452 + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
2453 + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
2454 + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
2455 + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
2456 + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
2457 + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
2458 + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
2459 + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
2460 + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
2461 + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
2462 + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
2463 + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
2464 + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
2465 + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
2466 + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
2467 + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
2468 + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
2469 + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
2470 + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
2471 + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
2472 + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
2473 + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
2474 + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
2475 + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
2476 + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
2477 + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
2478 + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
2479 + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
2480 + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
2481 + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
2482 + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
2483 + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
2484 + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
2485 + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
2486 + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
2487 + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
2488 + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
2489 + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
2490 + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
2491 + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
2492 + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
2493 + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
2494 + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
2495 + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
2496 + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
2497 + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
2498 + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
2499 + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
2500 + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
2501 + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
2502 + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
2503 + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
2504 + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
2505 + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
2506 + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
2508 +#endif // BCMTAG_USE
2511 +#endif // _BCMTAG_H_
2513 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcm_intr.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcm_intr.h
2514 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcm_intr.h 1970-01-01 01:00:00.000000000 +0100
2515 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcm_intr.h 2006-07-05 15:21:58.000000000 +0200
2519 + Copyright 2003 Broadcom Corp. All Rights Reserved.
2521 + This program is free software; you can distribute it and/or modify it
2522 + under the terms of the GNU General Public License (Version 2) as
2523 + published by the Free Software Foundation.
2525 + This program is distributed in the hope it will be useful, but WITHOUT
2526 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2527 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2530 + You should have received a copy of the GNU General Public License along
2531 + with this program; if not, write to the Free Software Foundation, Inc.,
2532 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2536 +#ifndef __BCM_INTR_H
2537 +#define __BCM_INTR_H
2543 +#if defined(CONFIG_BCM96338)
2544 +#include <6338_intr.h>
2546 +#if defined(CONFIG_BCM96345)
2547 +#include <6345_intr.h>
2549 +#if defined(CONFIG_BCM96348)
2550 +#include <6348_intr.h>
2555 +typedef int (*FN_HANDLER) (int, void *, struct pt_regs *);
2558 +extern void enable_brcm_irq(unsigned int irq);
2559 +extern void disable_brcm_irq(unsigned int irq);
2560 +extern int request_external_irq(unsigned int irq,
2561 + FN_HANDLER handler, unsigned long irqflags,
2562 + const char * devname, void *dev_id);
2563 +extern unsigned int BcmHalMapInterrupt(FN_HANDLER isr, unsigned int param,
2564 + unsigned int interruptId);
2565 +extern void dump_intr_regs(void);
2567 +/* compatibility definitions */
2568 +#define BcmHalInterruptEnable(irq) enable_brcm_irq( irq )
2569 +#define BcmHalInterruptDisable(irq) disable_brcm_irq( irq )
2576 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcm_map_part.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcm_map_part.h
2577 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcm_map_part.h 1970-01-01 01:00:00.000000000 +0100
2578 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcm_map_part.h 2006-07-05 15:21:58.000000000 +0200
2582 + Copyright 2004 Broadcom Corp. All Rights Reserved.
2584 + This program is free software; you can distribute it and/or modify it
2585 + under the terms of the GNU General Public License (Version 2) as
2586 + published by the Free Software Foundation.
2588 + This program is distributed in the hope it will be useful, but WITHOUT
2589 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2590 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2593 + You should have received a copy of the GNU General Public License along
2594 + with this program; if not, write to the Free Software Foundation, Inc.,
2595 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2599 +#ifndef __BCM_MAP_PART_H
2600 +#define __BCM_MAP_PART_H
2602 +#if defined(CONFIG_BCM96338)
2603 +#include <6338_map_part.h>
2605 +#if defined(CONFIG_BCM96345)
2606 +#include <6345_map_part.h>
2608 +#if defined(CONFIG_BCM96348)
2609 +#include <6348_map_part.h>
2614 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcmpci.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcmpci.h
2615 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcmpci.h 1970-01-01 01:00:00.000000000 +0100
2616 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcmpci.h 2006-07-05 15:21:58.000000000 +0200
2620 + Copyright 2004 Broadcom Corp. All Rights Reserved.
2622 + This program is free software; you can distribute it and/or modify it
2623 + under the terms of the GNU General Public License (Version 2) as
2624 + published by the Free Software Foundation.
2626 + This program is distributed in the hope it will be useful, but WITHOUT
2627 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2628 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2631 + You should have received a copy of the GNU General Public License along
2632 + with this program; if not, write to the Free Software Foundation, Inc.,
2633 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2638 +// bcmpci.h - bcm96348 PCI, Cardbus, and PCMCIA definition
2643 +/* Memory window in internal system bus address space */
2644 +#define BCM_PCI_MEM_BASE 0x08000000
2645 +/* IO window in internal system bus address space */
2646 +#define BCM_PCI_IO_BASE 0x0C000000
2648 +#define BCM_PCI_ADDR_MASK 0x1fffffff
2650 +/* Memory window size (range) */
2651 +#define BCM_PCI_MEM_SIZE_16MB 0x01000000
2652 +/* IO window size (range) */
2653 +#define BCM_PCI_IO_SIZE_64KB 0x00010000
2655 +/* PCI Configuration and I/O space acesss */
2656 +#define BCM_PCI_CFG(d, f, o) ( (d << 11) | (f << 8) | (o/4 << 2) )
2658 +/* fake USB PCI slot */
2659 +#define USB_HOST_SLOT 9
2660 +#define USB_BAR0_MEM_SIZE 0x0800
2662 +#define BCM_HOST_MEM_SPACE1 0x10000000
2663 +#define BCM_HOST_MEM_SPACE2 0x00000000
2666 + * EBI bus clock is 33MHz and share with PCI bus
2667 + * each clock cycle is 30ns.
2669 +/* attribute memory access wait cnt for 4306 */
2670 +#define PCMCIA_ATTR_CE_HOLD 3 // data hold time 70ns
2671 +#define PCMCIA_ATTR_CE_SETUP 3 // data setup time 50ns
2672 +#define PCMCIA_ATTR_INACTIVE 6 // time between read/write cycles 180ns. For the total cycle time 600ns (cnt1+cnt2+cnt3+cnt4)
2673 +#define PCMCIA_ATTR_ACTIVE 10 // OE/WE pulse width 300ns
2675 +/* common memory access wait cnt for 4306 */
2676 +#define PCMCIA_MEM_CE_HOLD 1 // data hold time 30ns
2677 +#define PCMCIA_MEM_CE_SETUP 1 // data setup time 30ns
2678 +#define PCMCIA_MEM_INACTIVE 2 // time between read/write cycles 40ns. For the total cycle time 250ns (cnt1+cnt2+cnt3+cnt4)
2679 +#define PCMCIA_MEM_ACTIVE 5 // OE/WE pulse width 150ns
2681 +#define PCCARD_VCC_MASK 0x00070000 // Mask Reset also
2682 +#define PCCARD_VCC_33V 0x00010000
2683 +#define PCCARD_VCC_50V 0x00020000
2686 + MPI_CARDTYPE_NONE, // No Card in slot
2687 + MPI_CARDTYPE_PCMCIA, // 16-bit PCMCIA card in slot
2688 + MPI_CARDTYPE_CARDBUS, // 32-bit CardBus card in slot
2691 +#define CARDBUS_SLOT 0 // Slot 0 is default for CardBus
2693 +#define pcmciaAttrOffset 0x00200000
2694 +#define pcmciaMemOffset 0x00000000
2695 +// Needs to be right above PCI I/O space. Give 0x8000 (32K) to PCMCIA.
2696 +#define pcmciaIoOffset (BCM_PCI_IO_BASE + 0x80000)
2697 +// Base Address is that mapped into the MPI ChipSelect registers.
2698 +// UBUS bridge MemoryWindow 0 outputs a 0x00 for the base.
2699 +#define pcmciaBase 0xbf000000
2700 +#define pcmciaAttr (pcmciaAttrOffset | pcmciaBase)
2701 +#define pcmciaMem (pcmciaMemOffset | pcmciaBase)
2702 +#define pcmciaIo (pcmciaIoOffset | pcmciaBase)
2705 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcmtypes.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcmtypes.h
2706 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/bcmtypes.h 1970-01-01 01:00:00.000000000 +0100
2707 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/bcmtypes.h 2006-07-05 15:21:58.000000000 +0200
2711 + Copyright 2002 Broadcom Corp. All Rights Reserved.
2713 + This program is free software; you can distribute it and/or modify it
2714 + under the terms of the GNU General Public License (Version 2) as
2715 + published by the Free Software Foundation.
2717 + This program is distributed in the hope it will be useful, but WITHOUT
2718 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2719 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2722 + You should have received a copy of the GNU General Public License along
2723 + with this program; if not, write to the Free Software Foundation, Inc.,
2724 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2729 +// bcmtypes.h - misc useful typedefs
2734 +// These are also defined in typedefs.h in the application area, so I need to
2735 +// protect against re-definition.
2737 +#ifndef _TYPEDEFS_H_
2738 +typedef unsigned char uint8;
2739 +typedef unsigned short uint16;
2740 +typedef unsigned long uint32;
2741 +typedef signed char int8;
2742 +typedef signed short int16;
2743 +typedef signed long int32;
2744 +#if !defined(__cplusplus)
2749 +typedef unsigned char byte;
2750 +// typedef unsigned long sem_t;
2752 +typedef unsigned long HANDLE,*PULONG,DWORD,*PDWORD;
2753 +typedef signed long LONG,*PLONG;
2755 +typedef unsigned int *PUINT;
2756 +typedef signed int INT;
2758 +typedef unsigned short *PUSHORT;
2759 +typedef signed short SHORT,*PSHORT;
2760 +typedef unsigned short WORD,*PWORD;
2762 +typedef unsigned char *PUCHAR;
2763 +typedef signed char *PCHAR;
2765 +typedef void *PVOID;
2767 +typedef unsigned char BOOLEAN, *PBOOL, *PBOOLEAN;
2769 +typedef unsigned char BYTE,*PBYTE;
2772 +//The following has been defined in Vxworks internally: vxTypesOld.h
2773 +//redefine under vxworks will cause error
2774 +typedef signed int *PINT;
2776 +typedef signed char INT8;
2777 +typedef signed short INT16;
2778 +typedef signed long INT32;
2780 +typedef unsigned char UINT8;
2781 +typedef unsigned short UINT16;
2782 +typedef unsigned long UINT32;
2784 +typedef unsigned char UCHAR;
2785 +typedef unsigned short USHORT;
2786 +typedef unsigned int UINT;
2787 +typedef unsigned long ULONG;
2790 +typedef unsigned char BOOL;
2792 +//#endif /* __GNUC__ */
2795 +// These are also defined in typedefs.h in the application area, so I need to
2796 +// protect against re-definition.
2799 +// Maximum and minimum values for a signed 16 bit integer.
2800 +#define MAX_INT16 32767
2801 +#define MIN_INT16 -32768
2803 +// Useful for true/false return values. This uses the
2804 +// Taligent notation (k for constant).
2813 +/* macros to protect against unaligned accesses */
2816 +/* first arg is an address, second is a value */
2817 +#define PUT16( a, d ) { \
2818 + *((byte *)a) = (byte)((d)>>8); \
2819 + *(((byte *)a)+1) = (byte)(d); \
2822 +#define PUT32( a, d ) { \
2823 + *((byte *)a) = (byte)((d)>>24); \
2824 + *(((byte *)a)+1) = (byte)((d)>>16); \
2825 + *(((byte *)a)+2) = (byte)((d)>>8); \
2826 + *(((byte *)a)+3) = (byte)(d); \
2829 +/* first arg is an address, returns a value */
2830 +#define GET16( a ) ( \
2831 + (*((byte *)a) << 8) | \
2832 + (*(((byte *)a)+1)) \
2835 +#define GET32( a ) ( \
2836 + (*((byte *)a) << 24) | \
2837 + (*(((byte *)a)+1) << 16) | \
2838 + (*(((byte *)a)+2) << 8) | \
2839 + (*(((byte *)a)+3)) \
2867 +#define READ32(addr) (*(volatile UINT32 *)((ULONG)&addr))
2868 +#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr))
2869 +#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr))
2872 diff -Naurp linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/board.h linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/board.h
2873 --- linux-2.6.16.7-generic-patched/bcmdrivers/opensource/include/bcm963xx/board.h 1970-01-01 01:00:00.000000000 +0100
2874 +++ linux-2.6.16.7-patched/bcmdrivers/opensource/include/bcm963xx/board.h 2006-07-05 15:21:58.000000000 +0200
2878 + Copyright 2002 Broadcom Corp. All Rights Reserved.
2880 + This program is free software; you can distribute it and/or modify it
2881 + under the terms of the GNU General Public License (Version 2) as
2882 + published by the Free Software Foundation.
2884 + This program is distributed in the hope it will be useful, but WITHOUT
2885 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2886 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2889 + You should have received a copy of the GNU General Public License along
2890 + with this program; if not, write to the Free Software Foundation, Inc.,
2891 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
2894 +/***********************************************************************/
2896 +/* MODULE: board.h */
2897 +/* DATE: 97/02/18 */
2898 +/* PURPOSE: Board specific information. This module should include */
2899 +/* all base device addresses and board specific macros. */
2901 +/***********************************************************************/
2908 +/*****************************************************************************/
2909 +/* Misc board definitions */
2910 +/*****************************************************************************/
2912 +#define DYING_GASP_API
2914 +/*****************************************************************************/
2915 +/* Physical Memory Map */
2916 +/*****************************************************************************/
2918 +#define PHYS_DRAM_BASE 0x00000000 /* Dynamic RAM Base */
2919 +#define PHYS_FLASH_BASE 0x1FC00000 /* Flash Memory */
2921 +/*****************************************************************************/
2922 +/* Note that the addresses above are physical addresses and that programs */
2923 +/* have to use converted addresses defined below: */
2924 +/*****************************************************************************/
2925 +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
2926 +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
2927 +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
2929 +/*****************************************************************************/
2930 +/* Select the PLL value to get the desired CPU clock frequency. */
2933 +/*****************************************************************************/
2934 +#define FPERIPH 50000000
2937 +#define BLK64K (64*ONEK)
2938 +#define FLASH45_BLKS_BOOT_ROM 1
2939 +#define FLASH45_LENGTH_BOOT_ROM (FLASH45_BLKS_BOOT_ROM * BLK64K)
2940 +#define FLASH_RESERVED_AT_END (64*ONEK) /*reserved for PSI, scratch pad*/
2942 +/*****************************************************************************/
2943 +/* Note that the addresses above are physical addresses and that programs */
2944 +/* have to use converted addresses defined below: */
2945 +/*****************************************************************************/
2946 +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
2947 +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
2948 +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
2950 +/*****************************************************************************/
2951 +/* Select the PLL value to get the desired CPU clock frequency. */
2954 +/*****************************************************************************/
2955 +#define FPERIPH 50000000
2957 +#define SDRAM_TYPE_ADDRESS_OFFSET 16
2958 +#define NVRAM_DATA_OFFSET 0x0580
2959 +#define NVRAM_DATA_ID 0x0f1e2d3c
2960 +#define BOARD_SDRAM_TYPE *(unsigned long *) \
2961 + (FLASH_BASE + SDRAM_TYPE_ADDRESS_OFFSET)
2964 +#define BLK64K (64*ONEK)
2966 +// nvram and psi flash definitions for 45
2967 +#define FLASH45_LENGTH_NVRAM ONEK // 1k nvram
2968 +#define NVRAM_PSI_DEFAULT 24 // default psi in K byes
2970 +/*****************************************************************************/
2971 +/* NVRAM Offset and definition */
2972 +/*****************************************************************************/
2974 +#define NVRAM_VERSION_NUMBER 2
2975 +#define NVRAM_VERSION_NUMBER_ADDRESS 0
2977 +#define NVRAM_BOOTLINE_LEN 256
2978 +#define NVRAM_BOARD_ID_STRING_LEN 16
2979 +#define NVRAM_MAC_ADDRESS_LEN 6
2980 +#define NVRAM_MAC_COUNT_MAX 32
2982 +/*****************************************************************************/
2984 +/*****************************************************************************/
2986 +#define CFE_VERSION_OFFSET 0x0570
2987 +#define CFE_VERSION_MARK_SIZE 5
2988 +#define CFE_VERSION_SIZE 5
2992 + unsigned long ulVersion;
2993 + char szBootline[NVRAM_BOOTLINE_LEN];
2994 + char szBoardId[NVRAM_BOARD_ID_STRING_LEN];
2995 + unsigned long ulReserved1[2];
2996 + unsigned long ulNumMacAddrs;
2997 + unsigned char ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
2998 + char chReserved[2];
2999 + unsigned long ulCheckSum;
3000 +} NVRAM_DATA, *PNVRAM_DATA;
3003 +/*****************************************************************************/
3004 +/* board ioctl calls for flash, led and some other utilities */
3005 +/*****************************************************************************/
3008 +/* Defines. for board driver */
3009 +#define BOARD_IOCTL_MAGIC 'B'
3010 +#define BOARD_DRV_MAJOR 206
3012 +#define MAC_ADDRESS_ANY (unsigned long) -1
3014 +#define BOARD_IOCTL_FLASH_INIT \
3015 + _IOWR(BOARD_IOCTL_MAGIC, 0, BOARD_IOCTL_PARMS)
3017 +#define BOARD_IOCTL_FLASH_WRITE \
3018 + _IOWR(BOARD_IOCTL_MAGIC, 1, BOARD_IOCTL_PARMS)
3020 +#define BOARD_IOCTL_FLASH_READ \
3021 + _IOWR(BOARD_IOCTL_MAGIC, 2, BOARD_IOCTL_PARMS)
3023 +#define BOARD_IOCTL_GET_NR_PAGES \
3024 + _IOWR(BOARD_IOCTL_MAGIC, 3, BOARD_IOCTL_PARMS)
3026 +#define BOARD_IOCTL_DUMP_ADDR \
3027 + _IOWR(BOARD_IOCTL_MAGIC, 4, BOARD_IOCTL_PARMS)
3029 +#define BOARD_IOCTL_SET_MEMORY \
3030 + _IOWR(BOARD_IOCTL_MAGIC, 5, BOARD_IOCTL_PARMS)
3032 +#define BOARD_IOCTL_MIPS_SOFT_RESET \
3033 + _IOWR(BOARD_IOCTL_MAGIC, 6, BOARD_IOCTL_PARMS)
3035 +#define BOARD_IOCTL_LED_CTRL \
3036 + _IOWR(BOARD_IOCTL_MAGIC, 7, BOARD_IOCTL_PARMS)
3038 +#define BOARD_IOCTL_GET_ID \
3039 + _IOWR(BOARD_IOCTL_MAGIC, 8, BOARD_IOCTL_PARMS)
3041 +#define BOARD_IOCTL_GET_MAC_ADDRESS \
3042 + _IOWR(BOARD_IOCTL_MAGIC, 9, BOARD_IOCTL_PARMS)
3044 +#define BOARD_IOCTL_RELEASE_MAC_ADDRESS \
3045 + _IOWR(BOARD_IOCTL_MAGIC, 10, BOARD_IOCTL_PARMS)
3047 +#define BOARD_IOCTL_GET_PSI_SIZE \
3048 + _IOWR(BOARD_IOCTL_MAGIC, 11, BOARD_IOCTL_PARMS)
3050 +#define BOARD_IOCTL_GET_SDRAM_SIZE \
3051 + _IOWR(BOARD_IOCTL_MAGIC, 12, BOARD_IOCTL_PARMS)
3053 +#define BOARD_IOCTL_SET_MONITOR_FD \
3054 + _IOWR(BOARD_IOCTL_MAGIC, 13, BOARD_IOCTL_PARMS)
3056 +#define BOARD_IOCTL_WAKEUP_MONITOR_TASK \
3057 + _IOWR(BOARD_IOCTL_MAGIC, 14, BOARD_IOCTL_PARMS)
3059 +#define BOARD_IOCTL_GET_BOOTLINE \
3060 + _IOWR(BOARD_IOCTL_MAGIC, 15, BOARD_IOCTL_PARMS)
3062 +#define BOARD_IOCTL_SET_BOOTLINE \
3063 + _IOWR(BOARD_IOCTL_MAGIC, 16, BOARD_IOCTL_PARMS)
3065 +#define BOARD_IOCTL_GET_BASE_MAC_ADDRESS \
3066 + _IOWR(BOARD_IOCTL_MAGIC, 17, BOARD_IOCTL_PARMS)
3068 +#define BOARD_IOCTL_GET_CHIP_ID \
3069 + _IOWR(BOARD_IOCTL_MAGIC, 18, BOARD_IOCTL_PARMS)
3071 +#define BOARD_IOCTL_GET_NUM_ENET \
3072 + _IOWR(BOARD_IOCTL_MAGIC, 19, BOARD_IOCTL_PARMS)
3074 +#define BOARD_IOCTL_GET_CFE_VER \
3075 + _IOWR(BOARD_IOCTL_MAGIC, 20, BOARD_IOCTL_PARMS)
3077 +#define BOARD_IOCTL_GET_ENET_CFG \
3078 + _IOWR(BOARD_IOCTL_MAGIC, 21, BOARD_IOCTL_PARMS)
3080 +#define BOARD_IOCTL_GET_WLAN_ANT_INUSE \
3081 + _IOWR(BOARD_IOCTL_MAGIC, 22, BOARD_IOCTL_PARMS)
3083 +#define BOARD_IOCTL_SET_TRIGGER_EVENT \
3084 + _IOWR(BOARD_IOCTL_MAGIC, 23, BOARD_IOCTL_PARMS)
3086 +#define BOARD_IOCTL_GET_TRIGGER_EVENT \
3087 + _IOWR(BOARD_IOCTL_MAGIC, 24, BOARD_IOCTL_PARMS)
3089 +#define BOARD_IOCTL_UNSET_TRIGGER_EVENT \
3090 + _IOWR(BOARD_IOCTL_MAGIC, 25, BOARD_IOCTL_PARMS)
3092 +#define BOARD_IOCTL_SET_SES_LED \
3093 + _IOWR(BOARD_IOCTL_MAGIC, 26, BOARD_IOCTL_PARMS)
3095 +//<<JUNHON, 2004/09/15, get reset button status , tim hou , 05/04/12
3096 +#define RESET_BUTTON_UP 1
3097 +#define RESET_BUTTON_PRESSDOWN 0
3098 +#define BOARD_IOCTL_GET_RESETHOLD \
3099 + _IOWR(BOARD_IOCTL_MAGIC, 27, BOARD_IOCTL_PARMS)
3100 +//>>JUNHON, 2004/09/15
3102 +// for the action in BOARD_IOCTL_PARMS for flash operation
3113 +} BOARD_IOCTL_ACTION;
3116 +typedef struct boardIoctParms
3122 + BOARD_IOCTL_ACTION action; /* flash read/write: nvram, persistent, bcm image */
3124 +} BOARD_IOCTL_PARMS;
3138 + kLedEnd, // NOTE: Insert the new led name before this one. Alway stay at the end.
3143 + kLedStateOff, /* turn led off */
3144 + kLedStateOn, /* turn led on */
3145 + kLedStateFail, /* turn led on red */
3146 + kLedStateBlinkOnce, /* blink once, ~100ms and ignore the same call during the 100ms period */
3147 + kLedStateSlowBlinkContinues, /* slow blink continues at ~600ms interval */
3148 + kLedStateFastBlinkContinues, /* fast blink continues at ~200ms interval */
3152 +// virtual and physical map pair defined in board.c
3153 +typedef struct ledmappair
3155 + BOARD_LED_NAME ledName; // virtual led name
3156 + BOARD_LED_STATE ledInitState; // initial led state when the board boots.
3157 + unsigned short ledMask; // physical GPIO pin mask
3158 + unsigned short ledActiveLow; // reset bit to turn on LED
3159 + unsigned short ledMaskFail; // physical GPIO pin mask for state failure
3160 + unsigned short ledActiveLowFail;// reset bit to turn on LED
3161 +} LED_MAP_PAIR, *PLED_MAP_PAIR;
3163 +typedef void (*HANDLE_LED_FUNC)(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState);
3165 +/* Flash storage address information that is determined by the flash driver. */
3166 +typedef struct flashaddrinfo
3168 + int flash_persistent_start_blk;
3169 + int flash_persistent_number_blk;
3170 + int flash_persistent_length;
3171 + unsigned long flash_persistent_blk_offset;
3172 + int flash_scratch_pad_start_blk; // start before psi (SP_BUF_LEN)
3173 + int flash_scratch_pad_number_blk;
3174 + int flash_scratch_pad_length;
3175 + unsigned long flash_scratch_pad_blk_offset;
3176 + int flash_nvram_start_blk;
3177 + int flash_nvram_number_blk;
3178 + int flash_nvram_length;
3179 + unsigned long flash_nvram_blk_offset;
3180 +} FLASH_ADDR_INFO, *PFLASH_ADDR_INFO;
3182 +// scratch pad defines
3183 +/* SP - Persisten Scratch Pad format:
3184 + sp header : 32 bytes
3185 + tokenId-1 : 8 bytes
3186 + tokenId-1 len : 4 bytes
3189 + tokenId-n : 8 bytes
3190 + tokenId-n len : 4 bytes
3194 +#define MAGIC_NUM_LEN 8
3195 +#define MAGIC_NUMBER "gOGoBrCm"
3196 +#define TOKEN_NAME_LEN 16
3197 +#define SP_VERSION 1
3198 +#define SP_MAX_LEN 8 * 1024 // 8k buf before psi
3199 +#define SP_RESERVERD 16
3201 +typedef struct _SP_HEADER
3203 + char SPMagicNum[MAGIC_NUM_LEN]; // 8 bytes of magic number
3204 + int SPVersion; // version number
3205 + int SPUsedLen; // used sp len
3206 + char SPReserved[SP_RESERVERD]; // reservied, total 32 bytes
3207 +} SP_HEADER, *PSP_HEADER;
3209 +typedef struct _TOKEN_DEF
3211 + char tokenName[TOKEN_NAME_LEN];
3213 +} SP_TOKEN, *PSP_TOKEN;
3216 +/*****************************************************************************/
3217 +/* Function Prototypes */
3218 +/*****************************************************************************/
3219 +#if !defined(__ASM_ASM_H)
3220 +void dumpaddr( unsigned char *pAddr, int nLen );
3222 +void kerSysFlashAddrInfoGet(PFLASH_ADDR_INFO pflash_addr_info);
3223 +int kerSysNvRamGet(char *string, int strLen, int offset);
3224 +int kerSysNvRamSet(char *string, int strLen, int offset);
3225 +int kerSysPersistentGet(char *string, int strLen, int offset);
3226 +int kerSysPersistentSet(char *string, int strLen, int offset);
3227 +int kerSysScratchPadGet(char *tokName, char *tokBuf, int tokLen);
3228 +int kerSysScratchPadSet(char *tokName, char *tokBuf, int tokLen);
3229 +int kerSysBcmImageSet( int flash_start_addr, char *string, int size);
3230 +int kerSysGetMacAddress( unsigned char *pucaAddr, unsigned long ulId );
3231 +int kerSysReleaseMacAddress( unsigned char *pucaAddr );
3232 +int kerSysGetSdramSize( void );
3233 +void kerSysGetBootline(char *string, int strLen);
3234 +void kerSysSetBootline(char *string, int strLen);
3235 +void kerSysMipsSoftReset(void);
3236 +void kerSysLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
3237 +void kerSysLedRegisterHwHandler( BOARD_LED_NAME, HANDLE_LED_FUNC, int );
3238 +int kerSysFlashSizeGet(void);
3239 +void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context);
3240 +void kerSysDeregisterDyingGaspHandler(char *devname);
3241 +void kerSysWakeupMonitorTask( void );
3248 +#endif /* _BOARD_H */