1 --- a/drivers/char/hw_random/Kconfig
2 +++ b/drivers/char/hw_random/Kconfig
3 @@ -148,3 +148,16 @@ config HW_RANDOM_VIRTIO
5 To compile this driver as a module, choose M here: the
6 module will be called virtio-rng. If unsure, say N.
8 +config HW_RANDOM_UBICOM32
9 + tristate "Ubicom32 HW Random Number Generator support"
10 + depends on HW_RANDOM && UBICOM32
13 + This driver provides kernel-side support for the Random Number
14 + Generator hardware found on Ubicom32 processors.
16 + To compile this driver as a module, choose M here: the
17 + module will be called pasemi-rng.
20 --- a/drivers/char/hw_random/Makefile
21 +++ b/drivers/char/hw_random/Makefile
22 @@ -15,3 +15,4 @@ obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx
23 obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o
24 obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o
25 obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o
26 +obj-$(CONFIG_HW_RANDOM_UBICOM32) += ubicom32-rng.o
27 --- a/drivers/crypto/Kconfig
28 +++ b/drivers/crypto/Kconfig
29 @@ -61,6 +61,40 @@ config CRYPTO_DEV_GEODE
30 To compile this driver as a module, choose M here: the module
31 will be called geode-aes.
33 +config CRYPTO_UBICOM32
34 + bool "Ubicom32 Security Module"
37 + This is the ubicom32 hardware acceleration common code.
39 +config CRYPTO_AES_UBICOM32
40 + tristate "Ubicom32 AES implementation"
41 + depends on CRYPTO_UBICOM32
42 + select CRYPTO_ALGAPI
44 + This is the ubicom32 hardware AES implementation.
46 +config CRYPTO_DES_UBICOM32
47 + tristate "Ubicom32 DES implementation"
48 + depends on CRYPTO_UBICOM32
49 + select CRYPTO_ALGAPI
51 + This is the ubicom32 hardware DES and 3DES implementation.
53 +config CRYPTO_SHA1_UBICOM32
54 + tristate "Ubicom32 SHA1 implementation"
55 + depends on CRYPTO_UBICOM32
56 + select CRYPTO_ALGAPI
58 + This is the ubicom32 hardware SHA1 implementation.
60 +config CRYPTO_MD5_UBICOM32
61 + tristate "Ubicom32 MD5 implementation"
62 + depends on CRYPTO_UBICOM32
63 + select CRYPTO_ALGAPI
65 + This is the ubicom32 hardware MD5 implementation.
68 tristate "Support for PCI-attached cryptographic adapters"
70 --- a/drivers/mmc/host/Kconfig
71 +++ b/drivers/mmc/host/Kconfig
72 @@ -266,3 +266,10 @@ config GPIOMMC_CONFIGFS
74 This option automatically enables configfs support for gpiommc
75 if configfs is available.
78 + tristate "Ubicom32 MMC/SD host controller"
81 + This provides support for the SD/MMC hardware found on Ubicom32
83 --- a/drivers/mmc/host/Makefile
84 +++ b/drivers/mmc/host/Makefile
85 @@ -30,4 +30,5 @@ obj-$(CONFIG_MMC_S3C) += s3cmci.o
86 obj-$(CONFIG_MMC_SDRICOH_CS) += sdricoh_cs.o
87 obj-$(CONFIG_MMC_TMIO) += tmio_mmc.o
88 obj-$(CONFIG_GPIOMMC) += gpiommc.o
89 +obj-$(CONFIG_MMC_UBICOM32) += ubicom32sd.o
91 --- a/drivers/mtd/devices/Kconfig
92 +++ b/drivers/mtd/devices/Kconfig
93 @@ -104,6 +104,31 @@ config M25PXX_USE_FAST_READ
95 This option enables FAST_READ access supported by ST M25Pxx.
97 +config MTD_UBI32_NAND_SPI_ER
98 + tristate "UBI32_NAND SPI-ER support"
100 + This driver supports the Micron MT29F1G01 SPI-ER NAND flash chip
101 + using the built in flash controller on the Ubicom32 architecture.
102 + Partial page writes are not supported by this driver.
104 +config MTD_NAND_SPI_ER
105 + tristate "NAND SPI-ER support"
107 + This driver supports the Micron MT29F1G01 SPI-ER NAND flash chip
108 + using a generic SPI bus. Partial page writes are supported
111 +config MTD_UBI32_M25P80
112 + tristate "Ubicom processor support for most SPI Flash chips (AT26DF, M25P, W25X, ...)"
113 + depends on UBICOM32
116 + This enables access to most modern SPI flash chips, used for
117 + program and data storage. Series supported include Atmel AT26DF,
118 + Spansion S25SL, SST 25VF, ST M25P, and Winbond W25X. Other chips
119 + are supported as well. See the driver source for the current list,
120 + or to add other chips.
123 tristate "Uncached system RAM"
125 --- a/drivers/mtd/devices/Makefile
126 +++ b/drivers/mtd/devices/Makefile
127 @@ -16,3 +16,6 @@ obj-$(CONFIG_MTD_LART) += lart.o
128 obj-$(CONFIG_MTD_BLOCK2MTD) += block2mtd.o
129 obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataflash.o
130 obj-$(CONFIG_MTD_M25P80) += m25p80.o
131 +obj-$(CONFIG_MTD_UBI32_M25P80) += ubi32-m25p80.o
132 +obj-$(CONFIG_MTD_NAND_SPI_ER) += nand-spi-er.o
133 +obj-$(CONFIG_MTD_UBI32_NAND_SPI_ER) += ubi32-nand-spi-er.o
134 --- a/drivers/net/Kconfig
135 +++ b/drivers/net/Kconfig
136 @@ -2540,6 +2540,19 @@ config JME
137 To compile this driver as a module, choose M here. The module
140 +config UBICOM32_GMAC
141 + tristate "Ubicom Gigabit Ethernet support"
142 + depends on UBICOM32
144 + Gigabit Ethernet support for ubicom32 processors
146 +config UBICOM32_OCM_FOR_SKB
147 + bool "USE OCM for SKB (EXPERIMENTAL)"
148 + depends on UBICOM32_GMAC
151 + Allocate skb from OCM for Ethernet Receive when possible
156 --- a/drivers/net/Makefile
157 +++ b/drivers/net/Makefile
158 @@ -272,3 +272,5 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
159 obj-$(CONFIG_SFC) += sfc/
161 obj-$(CONFIG_WIMAX) += wimax/
163 +obj-$(CONFIG_UBICOM32_GMAC) += ubi32-eth.o
164 --- a/drivers/net/usb/asix.c
165 +++ b/drivers/net/usb/asix.c
166 @@ -319,14 +319,33 @@ static int asix_rx_fixup(struct usbnet *
167 /* get the packet length */
168 size = (u16) (header & 0x0000ffff);
170 - if ((skb->len) - ((size + 1) & 0xfffe) == 0)
171 + if ((skb->len) - ((size + 1) & 0xfffe) == 0) {
172 +#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
173 + if (((u32)packet & 0x02) == 0) {
174 + memmove(packet - 2, packet, size);
182 if (size > ETH_FRAME_LEN) {
183 deverr(dev,"asix_rx_fixup() Bad RX Length %d", size);
186 ax_skb = skb_clone(skb, GFP_ATOMIC);
188 +#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
189 + if (((u32)packet & 0x02) == 0) {
190 + memmove(packet - 2, packet, size);
191 + ax_skb->data = packet - 2;
193 + ax_skb->data = packet;
196 + ax_skb->data = packet;
199 ax_skb->data = packet;
200 skb_set_tail_pointer(ax_skb, size);
201 @@ -1125,13 +1144,19 @@ static int ax88178_link_reset(struct usb
202 mode = AX88178_MEDIUM_DEFAULT;
204 if (ecmd.speed == SPEED_1000)
205 +#ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
206 mode |= AX_MEDIUM_GM;
208 + mode |= AX_MEDIUM_GM | AX_MEDIUM_ENCK;
210 else if (ecmd.speed == SPEED_100)
211 mode |= AX_MEDIUM_PS;
213 mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM);
215 +#ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
216 mode |= AX_MEDIUM_ENCK;
219 if (ecmd.duplex == DUPLEX_FULL)
220 mode |= AX_MEDIUM_FD;
221 --- a/drivers/oprofile/cpu_buffer.c
222 +++ b/drivers/oprofile/cpu_buffer.c
223 @@ -328,10 +328,10 @@ static inline void oprofile_end_trace(st
227 -__oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
228 - unsigned long event, int is_kernel)
229 +__oprofile_add_ext_sample_cpu(unsigned long pc, struct pt_regs * const regs,
230 + unsigned long event, int is_kernel, int cpu)
232 - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer);
233 + struct oprofile_cpu_buffer *cpu_buf = &per_cpu(cpu_buffer, cpu);
234 unsigned long backtrace = oprofile_backtrace_depth;
237 @@ -353,7 +353,8 @@ __oprofile_add_ext_sample(unsigned long
238 void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
239 unsigned long event, int is_kernel)
241 - __oprofile_add_ext_sample(pc, regs, event, is_kernel);
242 + __oprofile_add_ext_sample_cpu(pc, regs, event,
243 + is_kernel, smp_processor_id());
246 void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
247 @@ -361,7 +362,8 @@ void oprofile_add_sample(struct pt_regs
248 int is_kernel = !user_mode(regs);
249 unsigned long pc = profile_pc(regs);
251 - __oprofile_add_ext_sample(pc, regs, event, is_kernel);
252 + __oprofile_add_ext_sample_cpu(pc, regs, event,
253 + is_kernel, smp_processor_id());
257 --- a/drivers/pci/Makefile
258 +++ b/drivers/pci/Makefile
259 @@ -44,8 +44,8 @@ obj-$(CONFIG_PPC) += setup-bus.o
260 obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
261 obj-$(CONFIG_X86_VISWS) += setup-irq.o
262 obj-$(CONFIG_MN10300) += setup-bus.o
263 +obj-$(CONFIG_UBICOM32) += setup-bus.o setup-irq.o
266 # ACPI Related PCI FW Functions
268 obj-$(CONFIG_ACPI) += pci-acpi.o
269 --- a/drivers/serial/Kconfig
270 +++ b/drivers/serial/Kconfig
271 @@ -871,6 +871,57 @@ config SERIAL_UARTLITE_CONSOLE
272 console (the system console is the device which receives all kernel
273 messages and warnings and which allows logins in single user mode).
275 +config SERIAL_UBI32_UARTTIO
276 + tristate "Ubicom UARTTIO support"
277 + depends on UBICOM32=y
281 + Add support for the Ubicom virtual peripherial serial interface.
283 +config SERIAL_UBI32_UARTTIO_NR_UARTS
284 + int "Maximum number of UARTTIO virtual serial ports"
285 + depends on SERIAL_UBI32_UARTTIO
288 + Set this to the maximum number of serial ports you want the driver to support.
290 +config SERIAL_UBI32_UARTTIO_CONSOLE
291 + tristate "Ubicom UARTTIO console support"
292 + depends on SERIAL_UBI32_UARTTIO=y
293 + select SERIAL_CORE_CONSOLE
296 + Add support for console on the Ubicom virtual peripherial serial interface.
298 +config SERIAL_UBI32_SERDES
299 + bool "Ubicom serial port support"
300 + depends on UBICOM32=y
304 + Add support for the Ubicom serial interface.
306 +config SERIAL_UBI32_SERDES_CONSOLE
307 + bool "Ubicom serial console support"
308 + depends on SERIAL_UBI32_SERDES=y
309 + select SERIAL_CORE_CONSOLE
312 +config SERIAL_UBI32_MAILBOX
313 + bool "Ubicom mailbox support"
314 + depends on UBICOM32=y
318 + Add support for the Ubicom mailbox interface.
320 +config SERIAL_UBI32_MAILBOX_CONSOLE
321 + bool "Ubicom mailbox console support"
322 + depends on SERIAL_UBI32_MAILBOX=y
323 + select SERIAL_CORE_CONSOLE
326 config SERIAL_SUNCORE
329 --- a/drivers/serial/Makefile
330 +++ b/drivers/serial/Makefile
331 @@ -77,3 +77,6 @@ obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIA
332 obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
333 obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
334 obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
335 +obj-$(CONFIG_SERIAL_UBI32_SERDES) += ubi32_serdes.o
336 +obj-$(CONFIG_SERIAL_UBI32_UARTTIO) += ubi32_uarttio.o
337 +obj-$(CONFIG_SERIAL_UBI32_MAILBOX) += ubi32_mailbox.o
338 --- a/drivers/spi/Kconfig
339 +++ b/drivers/spi/Kconfig
340 @@ -196,6 +196,15 @@ config SPI_S3C24XX
342 SPI driver for Samsung S3C24XX series ARM SoCs
344 +config SPI_UBICOM32_GPIO
345 + tristate "Ubicom32 SPI over GPIO"
346 + depends on SPI_MASTER && UBICOM32 && EXPERIMENTAL
350 + SPI driver for the Ubicom32 architecture using
351 + GPIO lines to provide the SPI bus.
353 config SPI_S3C24XX_GPIO
354 tristate "Samsung S3C24XX series SPI by GPIO"
355 depends on ARCH_S3C2410 && EXPERIMENTAL
356 --- a/drivers/spi/Makefile
357 +++ b/drivers/spi/Makefile
358 @@ -27,6 +27,7 @@ obj-$(CONFIG_SPI_ORION) += orion_spi.o
359 obj-$(CONFIG_SPI_MPC52xx_PSC) += mpc52xx_psc_spi.o
360 obj-$(CONFIG_SPI_MPC83xx) += spi_mpc83xx.o
361 obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o
362 +obj-$(CONFIG_SPI_UBICOM32_GPIO) += spi_ubicom32_gpio.o
363 obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx.o
364 obj-$(CONFIG_SPI_TXX9) += spi_txx9.o
365 obj-$(CONFIG_SPI_XILINX) += xilinx_spi.o
366 --- a/drivers/uio/Kconfig
367 +++ b/drivers/uio/Kconfig
368 @@ -89,4 +89,12 @@ config UIO_SERCOS3
370 If you compile this as a module, it will be called uio_sercos3.
372 +config UIO_UBICOM32RING
373 + tristate "Ubicom32 Ring Buffer driver"
376 + Userspace I/O interface for a Ubicom32 Ring Buffer.
378 + If you compile this as a module, it will be called uio_ubicom32ring
381 --- a/drivers/uio/Makefile
382 +++ b/drivers/uio/Makefile
383 @@ -5,3 +5,4 @@ obj-$(CONFIG_UIO_PDRV_GENIRQ) += uio_pdr
384 obj-$(CONFIG_UIO_SMX) += uio_smx.o
385 obj-$(CONFIG_UIO_AEC) += uio_aec.o
386 obj-$(CONFIG_UIO_SERCOS3) += uio_sercos3.o
387 +obj-$(CONFIG_UIO_UBICOM32RING) += uio_ubicom32ring.o
388 --- a/drivers/usb/gadget/epautoconf.c
389 +++ b/drivers/usb/gadget/epautoconf.c
390 @@ -154,6 +154,10 @@ ep_matches (
391 /* configure your hardware with enough buffering!! */
395 + case USB_ENDPOINT_XFER_BULK:
396 + if ((gadget->is_dualspeed) && (ep->maxpacket < 512))
401 --- a/drivers/usb/Kconfig
402 +++ b/drivers/usb/Kconfig
403 @@ -22,6 +22,7 @@ config USB_ARCH_HAS_HCD
404 default y if PCMCIA && !M32R # sl811_cs
405 default y if ARM # SL-811
406 default y if SUPERH # r8a66597-hcd
407 + default y if UBICOM32 # Ubicom's onchip USB Duial role controller
410 # many non-PCI SOC chips embed OHCI
411 --- a/drivers/usb/musb/Kconfig
412 +++ b/drivers/usb/musb/Kconfig
413 @@ -12,7 +12,7 @@ config USB_MUSB_HDRC
415 select TWL4030_USB if MACH_OMAP_3430SDP
417 - tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
418 + tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, Ubicom, ...)'
420 Say Y here if your system has a dual role high speed USB
421 controller based on the Mentor Graphics silicon IP. Then
422 --- a/drivers/usb/musb/Makefile
423 +++ b/drivers/usb/musb/Makefile
424 @@ -30,6 +30,10 @@ ifeq ($(CONFIG_BF52x),y)
425 musb_hdrc-objs += blackfin.o
428 +ifeq ($(CONFIG_UBICOM32), y)
429 + musb_hdrc-objs += ubi32_usb.o
432 ifeq ($(CONFIG_USB_GADGET_MUSB_HDRC),y)
433 musb_hdrc-objs += musb_gadget_ep0.o musb_gadget.o
435 --- a/drivers/usb/musb/musb_core.c
436 +++ b/drivers/usb/musb/musb_core.c
438 #include <asm/mach-types.h>
441 +#ifdef CONFIG_UBICOM32
442 +#include <asm/ip5000.h>
443 +#include <asm/ubicom32-tio.h>
444 +extern void ubi32_usb_init(void);
445 +extern void ubi32_usb_int_clr(void);
448 #include "musb_core.h"
451 @@ -147,8 +154,37 @@ static inline struct musb *dev_to_musb(s
454 /*-------------------------------------------------------------------------*/
455 +#if defined(CONFIG_UBICOM32)
458 + * Load an endpoint's FIFO
460 +void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 wCount, const u8 *pSource)
462 + void __iomem *fifo = hw_ep->fifo;
464 + prefetch((u8 *)pSource);
466 + DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
467 + 'T', hw_ep->epnum, fifo, wCount, pSource);
469 + usb_tio_write_fifo((u32)fifo, (u32)pSource, wCount);
474 + * Unload an endpoint's FIFO
476 +void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 wCount, u8 *pDest)
479 + void __iomem *fifo = hw_ep->fifo;
480 + DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
481 + 'R', hw_ep->epnum, fifo, wCount, pDest);
482 + usb_tio_read_fifo((u32)fifo, (u32)pDest, wCount);
485 -#if !defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_BLACKFIN)
486 +#elif !defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_BLACKFIN)
489 * Load an endpoint's FIFO
490 @@ -227,8 +263,7 @@ void musb_read_fifo(struct musb_hw_ep *h
491 readsb(fifo, dst, len);
495 -#endif /* normal PIO */
496 +#endif /* !T6010 && !BLACKFIN */
499 /*-------------------------------------------------------------------------*/
500 @@ -874,12 +909,19 @@ void musb_start(struct musb *musb)
501 musb_writeb(regs, MUSB_TESTMODE, 0);
503 /* put into basic highspeed mode and start session */
504 +#ifndef CONFIG_UBICOM32
505 musb_writeb(regs, MUSB_POWER, MUSB_POWER_ISOUPDATE
506 | MUSB_POWER_SOFTCONN
508 /* ENSUSPEND wedges tusb */
509 /* | MUSB_POWER_ENSUSPEND */
512 + musb_writeb(regs, MUSB_POWER, MUSB_POWER_HSENAB
513 + /* ENSUSPEND wedges tusb */
514 + /* | MUSB_POWER_ENSUSPEND */
519 devctl = musb_readb(regs, MUSB_DEVCTL);
520 @@ -1081,6 +1123,7 @@ static struct fifo_cfg __initdata mode_4
524 +#ifndef CONFIG_UBICOM32
526 * configure a fifo; for non-shared endpoints, this may be called
527 * once for a tx fifo and once for an rx fifo.
528 @@ -1240,7 +1283,7 @@ static int __init ep_config_from_table(s
533 +#endif /* CONFIG_UBICOM32 */
536 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false
537 @@ -1256,6 +1299,11 @@ static int __init ep_config_from_hw(stru
538 DBG(2, "<== static silicon ep config\n");
540 /* FIXME pick up ep0 maxpacket size */
541 +#ifdef CONFIG_UBICOM32
542 + /* set ep0 to shared_fifo, otherwise urb will be put to out_qh but ep0_irq try to get the urb from in_qh*/
543 + hw_ep = musb->endpoints;
544 + hw_ep->is_shared_fifo = true;
547 for (epnum = 1; epnum < musb->config->num_eps; epnum++) {
548 musb_ep_select(mbase, epnum);
549 @@ -1276,14 +1324,27 @@ static int __init ep_config_from_hw(stru
550 /* REVISIT: this algorithm is lazy, we should at least
551 * try to pick a double buffered endpoint.
553 +#ifndef CONFIG_UBICOM32
556 musb->bulk_ep = hw_ep;
558 + if ((musb->bulk_ep_in) && (musb->bulk_ep_out))
560 + /* Save theEP with 1024 Bytes FIFO for ISO */
561 + if(hw_ep->max_packet_sz_tx == 512) {
562 + if (!musb->bulk_ep_in) {
563 + musb->bulk_ep_in = hw_ep;
564 + } else if (!musb->bulk_ep_out) {
565 + musb->bulk_ep_out = hw_ep;
568 +#endif /* CONFIG_UBICOM32 */
572 #ifdef CONFIG_USB_MUSB_HDRC_HCD
573 - if (!musb->bulk_ep) {
574 + if ((!musb->bulk_ep_in) || (!musb->bulk_ep_out)) {
575 pr_debug("%s: missing bulk\n", musb_driver_name);
578 @@ -1393,12 +1454,16 @@ static int __init musb_core_init(u16 mus
581 if (reg & MUSB_CONFIGDATA_DYNFIFO) {
582 +#ifndef CONFIG_UBICOM32
583 if (musb->config->dyn_fifo)
584 status = ep_config_from_table(musb);
589 ERR("reconfigure software for Dynamic FIFOs\n");
594 if (!musb->config->dyn_fifo)
595 status = ep_config_from_hw(musb);
596 @@ -1462,8 +1527,8 @@ static int __init musb_core_init(u16 mus
598 /*-------------------------------------------------------------------------*/
600 -#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
602 +#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_UBICOM32)
603 +static u32_t musb_int_count = 0;
604 static irqreturn_t generic_interrupt(int irq, void *__hci)
607 @@ -1472,10 +1537,17 @@ static irqreturn_t generic_interrupt(int
609 spin_lock_irqsave(&musb->lock, flags);
611 +#ifndef CONFIG_UBICOM32
612 musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
613 musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
614 musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
616 + musb_read_int_status(&musb->int_usb, &musb->int_tx, &musb->int_rx);
617 + //ubi32_usb_int_clr();
621 + DBG(4, "usb %x, tx %x, rx %x", musb->int_usb, musb->int_tx, musb->int_rx);
622 if (musb->int_usb || musb->int_tx || musb->int_rx)
623 retval = musb_interrupt(musb);
625 @@ -2210,6 +2282,10 @@ static struct platform_driver musb_drive
627 static int __init musb_init(void)
629 +#ifdef CONFIG_UBICOM32
633 #ifdef CONFIG_USB_MUSB_HDRC_HCD
636 --- a/drivers/usb/musb/musb_core.h
637 +++ b/drivers/usb/musb/musb_core.h
638 @@ -326,7 +326,12 @@ struct musb {
639 * queue until it completes or NAKs too much; then we try the next
642 +#ifdef CONFIG_UBICOM32
643 + struct musb_hw_ep *bulk_ep_in;
644 + struct musb_hw_ep *bulk_ep_out;
646 struct musb_hw_ep *bulk_ep;
649 struct list_head control; /* of musb_qh */
650 struct list_head in_bulk; /* of musb_qh */
651 --- a/drivers/usb/musb/musb_gadget.c
652 +++ b/drivers/usb/musb/musb_gadget.c
653 @@ -432,7 +432,7 @@ void musb_g_tx(struct musb *musb, u8 epn
654 * probably rates reporting as a host error
656 if (csr & MUSB_TXCSR_P_SENTSTALL) {
657 - csr |= MUSB_TXCSR_P_WZC_BITS;
658 + csr &= ~(MUSB_TXCSR_P_WZC_BITS);
659 csr &= ~MUSB_TXCSR_P_SENTSTALL;
660 musb_writew(epio, MUSB_TXCSR, csr);
661 if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
662 @@ -448,7 +448,7 @@ void musb_g_tx(struct musb *musb, u8 epn
664 if (csr & MUSB_TXCSR_P_UNDERRUN) {
665 /* we NAKed, no big deal ... little reason to care */
666 - csr |= MUSB_TXCSR_P_WZC_BITS;
667 + csr &= ~(MUSB_TXCSR_P_WZC_BITS);
668 csr &= ~(MUSB_TXCSR_P_UNDERRUN
669 | MUSB_TXCSR_TXPKTRDY);
670 musb_writew(epio, MUSB_TXCSR, csr);
671 @@ -584,10 +584,16 @@ static void rxstate(struct musb *musb, s
673 const u8 epnum = req->epnum;
674 struct usb_request *request = &req->request;
675 - struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
676 + struct musb_ep *musb_ep = NULL;
677 void __iomem *epio = musb->endpoints[epnum].regs;
678 - unsigned fifo_count = 0;
679 - u16 len = musb_ep->packet_sz;
680 + u16 fifo_count = 0;
683 + if (musb->endpoints[epnum].is_shared_fifo)
684 + musb_ep = &musb->endpoints[epnum].ep_in;
686 + musb_ep = &musb->endpoints[epnum].ep_out;
687 + len = musb_ep->packet_sz;
689 csr = musb_readw(epio, MUSB_RXCSR);
691 @@ -726,7 +732,7 @@ static void rxstate(struct musb *musb, s
695 - csr |= MUSB_RXCSR_P_WZC_BITS;
696 + csr &= ~MUSB_RXCSR_P_WZC_BITS;
697 csr &= ~MUSB_RXCSR_RXPKTRDY;
698 musb_writew(epio, MUSB_RXCSR, csr);
700 @@ -745,10 +751,15 @@ void musb_g_rx(struct musb *musb, u8 epn
702 struct usb_request *request;
703 void __iomem *mbase = musb->mregs;
704 - struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
705 + struct musb_ep *musb_ep = NULL;
706 void __iomem *epio = musb->endpoints[epnum].regs;
707 struct dma_channel *dma;
709 + if (musb->endpoints[epnum].is_shared_fifo)
710 + musb_ep = &musb->endpoints[epnum].ep_in;
712 + musb_ep = &musb->endpoints[epnum].ep_out;
714 musb_ep_select(mbase, epnum);
716 request = next_request(musb_ep);
717 @@ -1769,7 +1780,9 @@ int usb_gadget_register_driver(struct us
722 +#ifndef CONFIG_USB_MUSB_OTG
723 + musb_pullup(musb, 1);
727 EXPORT_SYMBOL(usb_gadget_register_driver);
728 --- a/drivers/usb/musb/musb_gadget_ep0.c
729 +++ b/drivers/usb/musb/musb_gadget_ep0.c
730 @@ -240,14 +240,14 @@ __acquires(musb->lock)
731 case USB_REQ_SET_ADDRESS:
732 /* change it after the status stage */
733 musb->set_address = true;
734 - musb->address = (u8) (ctrlrequest->wValue & 0x7f);
735 + musb->address = (u8) (le16_to_cpu(ctrlrequest->wValue) & 0x7f);
739 case USB_REQ_CLEAR_FEATURE:
741 case USB_RECIP_DEVICE:
742 - if (ctrlrequest->wValue
743 + if (le16_to_cpu(ctrlrequest->wValue)
744 != USB_DEVICE_REMOTE_WAKEUP)
746 musb->may_wakeup = 0;
747 @@ -261,8 +261,8 @@ __acquires(musb->lock)
750 || num >= MUSB_C_NUM_EPS
751 - || ctrlrequest->wValue
752 - != USB_ENDPOINT_HALT)
753 + || le16_to_cpu(ctrlrequest->wValue
754 + != USB_ENDPOINT_HALT))
757 if (ctrlrequest->wIndex & USB_DIR_IN)
758 @@ -292,7 +292,7 @@ __acquires(musb->lock)
760 case USB_RECIP_DEVICE:
762 - switch (ctrlrequest->wValue) {
763 + switch (le16_to_cpu(ctrlrequest->wValue)) {
764 case USB_DEVICE_REMOTE_WAKEUP:
765 musb->may_wakeup = 1;
767 @@ -374,8 +374,8 @@ stall:
770 || epnum >= MUSB_C_NUM_EPS
771 - || ctrlrequest->wValue
772 - != USB_ENDPOINT_HALT)
773 + || le16_to_cpu(ctrlrequest->wValue
774 + != USB_ENDPOINT_HALT))
777 ep = musb->endpoints + epnum;
778 --- a/drivers/usb/musb/musb_host.c
779 +++ b/drivers/usb/musb/musb_host.c
780 @@ -160,7 +160,11 @@ static inline void musb_h_tx_start(struc
781 /* NOTE: no locks here; caller should lock and select EP */
783 txcsr = musb_readw(ep->regs, MUSB_TXCSR);
784 +#ifndef CONFIG_UBICOM32
785 txcsr |= MUSB_TXCSR_TXPKTRDY | MUSB_TXCSR_H_WZC_BITS;
787 + txcsr |= (MUSB_TXCSR_TXPKTRDY & (~MUSB_TXCSR_H_WZC_BITS));
789 musb_writew(ep->regs, MUSB_TXCSR, txcsr);
791 txcsr = MUSB_CSR0_H_SETUPPKT | MUSB_CSR0_TXPKTRDY;
792 @@ -223,6 +227,8 @@ musb_start_urb(struct musb *musb, int is
794 default: /* bulk, interrupt */
795 /* actual_length may be nonzero on retry paths */
796 + if (urb->actual_length)
797 + DBG(3 ,"musb_start_urb: URB %p retried, len: %d\n", urb, urb->actual_length);
798 buf = urb->transfer_buffer + urb->actual_length;
799 len = urb->transfer_buffer_length - urb->actual_length;
801 @@ -342,13 +348,13 @@ musb_save_toggle(struct musb_hw_ep *ep,
803 csr = musb_readw(epio, MUSB_TXCSR);
804 usb_settoggle(udev, qh->epnum, 1,
805 - (csr & MUSB_TXCSR_H_DATATOGGLE)
807 + ((csr & MUSB_TXCSR_H_DATATOGGLE)
810 csr = musb_readw(epio, MUSB_RXCSR);
811 usb_settoggle(udev, qh->epnum, 0,
812 - (csr & MUSB_RXCSR_H_DATATOGGLE)
814 + ((csr & MUSB_RXCSR_H_DATATOGGLE)
819 @@ -556,7 +562,11 @@ musb_host_packet_rx(struct musb *musb, s
820 musb_read_fifo(hw_ep, length, buf);
822 csr = musb_readw(epio, MUSB_RXCSR);
823 +#ifndef CONFIG_UBICOM32
824 csr |= MUSB_RXCSR_H_WZC_BITS;
826 + csr &= ~MUSB_RXCSR_H_WZC_BITS;
828 if (unlikely(do_flush))
829 musb_h_flush_rxfifo(hw_ep, csr);
831 @@ -590,6 +600,7 @@ musb_rx_reinit(struct musb *musb, struct
833 /* if programmed for Tx, put it in RX mode */
834 if (ep->is_shared_fifo) {
835 +#ifndef CONFIG_UBICOM32
836 csr = musb_readw(ep->regs, MUSB_TXCSR);
837 if (csr & MUSB_TXCSR_MODE) {
838 musb_h_tx_flush_fifo(ep);
839 @@ -604,7 +615,18 @@ musb_rx_reinit(struct musb *musb, struct
841 if (csr & MUSB_TXCSR_DMAMODE)
842 musb_writew(ep->regs, MUSB_TXCSR, MUSB_TXCSR_DMAMODE);
845 + /* clear mode (and everything else) to enable Rx */
846 musb_writew(ep->regs, MUSB_TXCSR, 0);
847 + /* scrub all previous state, clearing toggle */
848 + csr = musb_readw(ep->regs, MUSB_RXCSR);
849 + if (csr & MUSB_RXCSR_RXPKTRDY)
850 + WARNING("rx%d, packet/%d ready?\n", ep->epnum,
851 + musb_readw(ep->regs, MUSB_RXCOUNT));
853 + musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
856 /* scrub all previous state, clearing toggle */
858 @@ -1138,8 +1160,18 @@ void musb_host_tx(struct musb *musb, u8
859 void __iomem *mbase = musb->mregs;
860 struct dma_channel *dma;
862 +#ifdef CONFIG_UBICOM32
863 + if (hw_ep->is_shared_fifo) {
866 +#ifdef CONFIG_USB_SERIAL_SIERRAWIRELESS
867 + printk(KERN_DEBUG "OUT/TX%d end, csr %04x%s\n", epnum, tx_csr,
868 + dma ? ", dma" : "");
874 musb_ep_select(mbase, epnum);
875 tx_csr = musb_readw(epio, MUSB_TXCSR);
877 @@ -1180,9 +1212,14 @@ void musb_host_tx(struct musb *musb, u8
878 * we have a candidate... NAKing is *NOT* an error
880 musb_ep_select(mbase, epnum);
881 +#ifndef CONFIG_UBICOM32
882 musb_writew(epio, MUSB_TXCSR,
883 MUSB_TXCSR_H_WZC_BITS
884 | MUSB_TXCSR_TXPKTRDY);
886 + musb_writew(epio, MUSB_TXCSR,
887 + MUSB_TXCSR_TXPKTRDY);
892 @@ -1353,8 +1390,14 @@ void musb_host_tx(struct musb *musb, u8
893 qh->segsize = length;
895 musb_ep_select(mbase, epnum);
896 +#ifndef CONFIG_UBICOM32
897 + musb_writew(epio, MUSB_TXCSR,
898 + MUSB_TXCSR_H_WZC_BITS | MUSB_TXCSR_TXPKTRDY);
900 musb_writew(epio, MUSB_TXCSR,
901 - MUSB_TXCSR_H_WZC_BITS | MUSB_TXCSR_TXPKTRDY);
902 + MUSB_TXCSR_MODE | MUSB_TXCSR_TXPKTRDY);
908 @@ -1414,7 +1457,11 @@ static void musb_bulk_rx_nak_timeout(str
910 /* clear nak timeout bit */
911 rx_csr = musb_readw(epio, MUSB_RXCSR);
912 +#ifndef CONFIG_UBICOM32
913 rx_csr |= MUSB_RXCSR_H_WZC_BITS;
915 + rx_csr &= ~MUSB_RXCSR_H_WZC_BITS;
917 rx_csr &= ~MUSB_RXCSR_DATAERROR;
918 musb_writew(epio, MUSB_RXCSR, rx_csr);
920 @@ -1483,6 +1530,13 @@ void musb_host_rx(struct musb *musb, u8
924 +#ifdef CONFIG_UBICOM32
925 +#ifdef CONFIG_USB_SERIAL_SIERRAWIRELESS
926 + printk(KERN_DEBUG "RXCSR%d %04x, reqpkt, len %zu%s\n", epnum, rx_csr,
927 + xfer_len, dma ? ", dma" : "");
931 DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)\n",
932 epnum, rx_csr, urb->actual_length,
933 dma ? dma->actual_len : 0);
934 @@ -1521,8 +1575,15 @@ void musb_host_rx(struct musb *musb, u8
937 musb_ep_select(mbase, epnum);
938 +#ifndef CONFIG_UBICOM32
939 rx_csr |= MUSB_RXCSR_H_WZC_BITS;
940 rx_csr &= ~MUSB_RXCSR_DATAERROR;
942 + /* NEED TO EVALUATE CHANGE */
943 + rx_csr &= ~MUSB_RXCSR_H_WZC_BITS;
944 + rx_csr &= ~MUSB_RXCSR_DATAERROR;
945 +// musb_writew(epio, MUSB_RXCSR, (~(MUSB_RXCSR_H_WZC_BITS))| MUSB_RXCSR_H_REQPKT);
947 musb_writew(epio, MUSB_RXCSR, rx_csr);
950 @@ -1579,8 +1640,13 @@ void musb_host_rx(struct musb *musb, u8
951 rx_csr &= ~MUSB_RXCSR_H_REQPKT;
953 musb_ep_select(mbase, epnum);
954 +#ifndef CONFIG_UBICOM32
955 musb_writew(epio, MUSB_RXCSR,
956 MUSB_RXCSR_H_WZC_BITS | rx_csr);
958 + musb_writew(epio, MUSB_RXCSR,
959 + (~MUSB_RXCSR_H_WZC_BITS) & rx_csr);
963 if (dma && (rx_csr & MUSB_RXCSR_DMAENAB)) {
964 @@ -1610,7 +1676,7 @@ void musb_host_rx(struct musb *musb, u8
970 /* done if urb buffer is full or short packet is recd */
971 done = (urb->actual_length + xfer_len >=
972 urb->transfer_buffer_length
973 @@ -1823,7 +1889,11 @@ static int musb_schedule(
974 } else if (hw_ep->out_qh != NULL)
977 +#ifndef CONFIG_UBICOM32
978 if (hw_ep == musb->bulk_ep)
980 + if ((hw_ep == musb->bulk_ep_in) || (hw_ep == musb->bulk_ep_out)) /* Ubicom */
985 @@ -1836,7 +1906,14 @@ static int musb_schedule(
990 +#ifdef CONFIG_UBICOM32
991 + if (((best_diff >= qh->maxpacket)) && ((qh->type == USB_ENDPOINT_XFER_BULK) && (!is_in)))
995 /* use bulk reserved ep1 if no other ep is free */
996 +#ifndef CONFIG_UBICOM32
997 if (best_end < 0 && qh->type == USB_ENDPOINT_XFER_BULK) {
998 hw_ep = musb->bulk_ep;
1000 @@ -1858,6 +1935,22 @@ static int musb_schedule(
1001 } else if (best_end < 0) {
1005 + if (best_end < 0 && qh->type == USB_ENDPOINT_XFER_BULK) {
1006 + /* hw_ep = musb->bulk_ep; */
1008 + head = &musb->in_bulk;
1009 + hw_ep = musb->bulk_ep_in; /* UBICOM */
1012 + head = &musb->out_bulk;
1013 + hw_ep = musb->bulk_ep_out; /* UBICOM */
1016 + } else if (best_end < 0) {
1023 @@ -1869,6 +1962,13 @@ success:
1024 list_add_tail(&qh->ring, head);
1028 + * It's not make sense to set NAK timeout when qh->mux = 0,
1029 + * There is nothing else to schedule
1031 + if ((qh->type == USB_ENDPOINT_XFER_BULK) && (qh->mux == 0))
1035 qh->hep->hcpriv = qh;
1037 @@ -1975,6 +2075,15 @@ static int musb_urb_enqueue(
1038 /* ISO always uses logarithmic encoding */
1039 interval = min_t(u8, epd->bInterval, 16);
1041 +#ifdef COMFIG_UBICOM32
1042 + case USB_ENDPOINT_XFER_BULK:
1043 + if (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
1044 + interval = (USB_SPEED_HIGH == urb->dev->speed) ? 16: 2;
1051 /* REVISIT we actually want to use NAK limits, hinting to the
1052 * transfer scheduling logic to try some other qh, e.g. try
1053 --- a/drivers/usb/musb/musb_io.h
1054 +++ b/drivers/usb/musb/musb_io.h
1055 @@ -58,6 +58,7 @@ static inline void writesb(const void __
1057 #ifndef CONFIG_BLACKFIN
1059 +#ifndef CONFIG_UBICOM32
1060 /* NOTE: these offsets are all in bytes */
1062 static inline u16 musb_readw(const void __iomem *addr, unsigned offset)
1063 @@ -72,7 +73,37 @@ static inline void musb_writew(void __io
1065 static inline void musb_writel(void __iomem *addr, unsigned offset, u32 data)
1066 { __raw_writel(data, addr + offset); }
1068 +#include <asm/ubicom32-tio.h>
1069 +static inline u16 musb_readw(const void __iomem *addr, unsigned offset)
1072 + usb_tio_read_u16((u32)(addr + offset), &data);
1076 +static inline u8 musb_readb(const void __iomem *addr, unsigned offset)
1079 + usb_tio_read_u8((u32)(addr + offset), &data);
1083 +static inline void musb_writew(void __iomem *addr, unsigned offset, u16 data)
1085 + usb_tio_write_u16((u32)(addr + offset), data);
1088 +static inline void musb_writeb(void __iomem *addr, unsigned offset, u8 data)
1090 + usb_tio_write_u8((u32)(addr + offset), data);
1093 +static inline void musb_read_int_status(u8_t *int_usb, u16_t *int_tx, u16_t *int_rx)
1095 + return usb_tio_read_int_status(int_usb, int_tx, int_rx);
1097 +#endif /* CONFIG_UBICOM32 */
1099 #ifdef CONFIG_USB_TUSB6010
1101 @@ -106,7 +137,7 @@ static inline void musb_writeb(void __io
1102 __raw_writew(tmp, addr + (offset & ~1));
1106 +#elif !defined(CONFIG_UBICOM32)
1108 static inline u8 musb_readb(const void __iomem *addr, unsigned offset)
1109 { return __raw_readb(addr + offset); }
1110 --- a/drivers/usb/musb/musb_regs.h
1111 +++ b/drivers/usb/musb/musb_regs.h
1113 (MUSB_TXCSR_H_NAKTIMEOUT | MUSB_TXCSR_H_RXSTALL \
1114 | MUSB_TXCSR_H_ERROR | MUSB_TXCSR_FIFONOTEMPTY)
1117 /* RXCSR in Peripheral and Host mode */
1118 #define MUSB_RXCSR_AUTOCLEAR 0x8000
1119 #define MUSB_RXCSR_DMAENAB 0x2000
1120 --- a/drivers/video/backlight/Kconfig
1121 +++ b/drivers/video/backlight/Kconfig
1122 @@ -93,6 +93,63 @@ config LCD_HP700
1123 If you have an HP Jornada 700 series handheld (710/720/728)
1124 say Y to enable LCD control driver.
1126 +config LCD_UBICOM32POWER
1127 + tristate "Ubicom LCD power Driver"
1128 + depends on LCD_CLASS_DEVICE && UBICOM32
1131 + If you have a Ubicom32 based system with an LCD panel that requires
1132 + power control, say Y to enable the power control driver for it.
1134 +config LCD_UBICOM32
1135 + tristate "Ubicom Backlight Driver"
1136 + depends on LCD_CLASS_DEVICE && UBICOM32
1139 + This driver takes care of initialization of LCD panels with
1140 + built in controllers.
1142 +menu "Ubicom32 LCD Panel Support"
1143 + depends on UBICOM32 && LCD_UBICOM32
1145 +config LCD_UBICOM32_TFT2N0369E_P
1146 + bool "TFT2N0369E (Portrait)"
1149 + Support for TFT2N0369 in portrait mode
1151 +config LCD_UBICOM32_TFT2N0369E_L
1152 + bool "TFT2N0369E (Landscape)"
1155 + Support for TFT2N0369 in landscape mode
1157 +config LCD_UBICOM32_CFAF240320KTTS
1158 + bool "CFAF240320KTTS"
1161 + Support for CFAF240320KTTS
1163 +config LCD_UBICOM32_CFAF240320KTTS_180
1164 + bool "CFAF240320KTTS (180 rotation)"
1167 + Support for CFAF240320KTTS rotated 180 degrees
1169 +config LCD_UBICOM32_CFAF240320D
1170 + bool "CFAF240320D"
1173 + Support for CFAF240320D
1175 +config LCD_UBICOM32_CFAF320240F
1176 + bool "CFAF320240F"
1179 + Support for CFAF320240F
1186 @@ -229,3 +286,11 @@ config BACKLIGHT_SAHARA
1188 If you have a Tabletkiosk Sahara Touch-iT, say y to enable the
1191 +config BACKLIGHT_UBICOM32
1192 + tristate "Ubicom Backlight Driver"
1193 + depends on BACKLIGHT_CLASS_DEVICE && UBICOM32
1196 + If you have a Ubicom32 based system with a backlight say Y to enable the
1198 --- a/drivers/video/backlight/Makefile
1199 +++ b/drivers/video/backlight/Makefile
1200 @@ -9,6 +9,9 @@ obj-$(CONFIG_LCD_PLATFORM) += platfor
1201 obj-$(CONFIG_LCD_VGG2432A4) += vgg2432a4.o
1202 obj-$(CONFIG_LCD_TDO24M) += tdo24m.o
1203 obj-$(CONFIG_LCD_TOSA) += tosa_lcd.o
1204 +obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o
1205 +obj-$(CONFIG_LCD_UBICOM32POWER) += ubicom32lcdpower.o
1206 +obj-$(CONFIG_LCD_UBICOM32) += ubicom32lcd.o
1208 obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
1209 obj-$(CONFIG_BACKLIGHT_ATMEL_PWM) += atmel-pwm-bl.o
1210 @@ -24,4 +27,4 @@ obj-$(CONFIG_BACKLIGHT_DA903X) += da903x
1211 obj-$(CONFIG_BACKLIGHT_MBP_NVIDIA) += mbp_nvidia_bl.o
1212 obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
1213 obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
1215 +obj-$(CONFIG_BACKLIGHT_UBICOM32) += ubicom32bl.o
1216 --- a/drivers/video/Kconfig
1217 +++ b/drivers/video/Kconfig
1218 @@ -609,6 +609,50 @@ config FB_BFIN_T350MCQB
1219 This display is a QVGA 320x240 24-bit RGB display interfaced by an 8-bit wide PPI
1220 It uses PPI[0..7] PPI_FS1, PPI_FS2 and PPI_CLK.
1223 + tristate "Ubicom32 Frame Buffer driver"
1224 + depends on FB && UBICOM32
1225 + select FB_CFB_FILLRECT
1226 + select FB_CFB_COPYAREA
1227 + select FB_CFB_IMAGEBLIT
1228 + select FONT_6x11 if FRAMEBUFFER_CONSOLE
1230 + This is the framebuffer device driver for the Ubicom32 architecture.
1231 + You can configure video memory by using kernel command line parameters, for example:
1232 + video=ubicomfb:vram_size=512,init_value=0xffff
1234 +config FB_UBICOM32_PLIO80
1235 + tristate "Ubicom32 80 Bus PLIO Frame Buffer driver"
1236 + depends on FB && UBICOM32
1237 + select FB_CFB_FILLRECT
1238 + select FB_CFB_COPYAREA
1239 + select FB_CFB_IMAGEBLIT
1240 + select FONT_6x11 if FRAMEBUFFER_CONSOLE
1241 + select UBICOM32_PLIO
1243 + This is a framebuffer device driver for the Ubicom32 architecture.
1244 + You can configure the xres, yres and vram size (in kilobytes) by using
1245 + kernel command line parameters, for example:
1246 + video=ubicom32vfb:xres=320,yres=240,vram_size=512
1248 +config FB_UBICOM32_VIRTUAL
1249 + tristate "Ubicom32 Virtual Frame Buffer driver"
1250 + depends on FB && UBICOM32
1251 + select FB_CFB_FILLRECT
1252 + select FB_CFB_COPYAREA
1253 + select FB_CFB_IMAGEBLIT
1254 + select FONT_6x11 if FRAMEBUFFER_CONSOLE
1256 + This is a virtual framebuffer device driver for the Ubicom32 architecture.
1257 + You can configure the xres, yres and vram size (in kilobytes) by using
1258 + kernel command line parameters, for example:
1259 + video=ubicom32vfb:xres=320,yres=240,vram_size=512
1261 +config FB_UBICOM32_VIRTUAL_NOAUTO
1262 + bool "Do not automatically load"
1263 + depends on FB_UBICOM32_VIRTUAL
1265 + Select this option to prevent the VFB from automatically loading at boot.
1268 tristate "HP STI frame buffer device support"
1269 --- a/drivers/video/Makefile
1270 +++ b/drivers/video/Makefile
1271 @@ -136,6 +136,10 @@ obj-$(CONFIG_FB_BF54X_LQ043) += bf54x-
1272 obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o
1273 obj-$(CONFIG_FB_MX3) += mx3fb.o
1275 +obj-$(CONFIG_FB_UBICOM32) += ubicom32fb.o
1276 +obj-$(CONFIG_FB_UBICOM32_PLIO80) += ubicom32plio80.o
1277 +obj-$(CONFIG_FB_UBICOM32_VIRTUAL) += ubicom32vfb.o
1279 # the test framebuffer is last
1280 obj-$(CONFIG_FB_VIRTUAL) += vfb.o
1282 --- a/drivers/watchdog/Kconfig
1283 +++ b/drivers/watchdog/Kconfig
1284 @@ -887,6 +887,19 @@ config WATCHDOG_RIO
1285 machines. The watchdog timeout period is normally one minute but
1286 can be changed with a boot-time parameter.
1291 + tristate "Ubicom32 Hardware Watchdog support"
1292 + depends on UBICOM32
1294 + If you say yes here you will get support for the Ubicom32 On-Chip
1295 + Watchdog Timer. If you have one of these processors and wish to
1296 + have watchdog support enabled, say Y, otherwise say N.
1298 + To compile this driver as a module, choose M here: the
1299 + module will be called ubi32_wdt.
1301 # XTENSA Architecture
1304 --- a/drivers/watchdog/Makefile
1305 +++ b/drivers/watchdog/Makefile
1306 @@ -131,6 +131,9 @@ obj-$(CONFIG_SH_WDT) += shwdt.o
1307 obj-$(CONFIG_WATCHDOG_RIO) += riowd.o
1308 obj-$(CONFIG_WATCHDOG_CP1XXX) += cpwd.o
1310 +# Ubicom32 Architecture
1311 +obj-$(CONFIG_UBI32_WDT) += ubi32_wdt.o
1313 # XTENSA Architecture
1315 # Architecture Independant
1316 --- a/fs/binfmt_flat.c
1317 +++ b/fs/binfmt_flat.c
1319 #define FLAT_DATA_ALIGN (sizeof(void *))
1322 +#ifndef ARCH_FLAT_ALIGN
1323 +#undef FLAT_DATA_ALIGN
1324 +#define FLAT_DATA_ALIGN ARCH_FLAT_ALIGN
1327 #define RELOC_FAILED 0xff00ff01 /* Relocation incorrect somewhere */
1328 #define UNLOADED_LIB 0x7ff000ff /* Placeholder for unused library */
1330 @@ -436,6 +441,7 @@ static int load_flat_file(struct linux_b
1332 unsigned long start_code, end_code;
1334 + int flush_happened = 0;
1336 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */
1337 inode = bprm->file->f_path.dentry->d_inode;
1338 @@ -521,6 +527,7 @@ static int load_flat_file(struct linux_b
1340 /* OK, This is the point of no return */
1341 set_personality(PER_LINUX_32BIT);
1342 + flush_happened = 1;
1346 @@ -535,6 +542,12 @@ static int load_flat_file(struct linux_b
1349 if ((flags & (FLAT_FLAG_RAM|FLAT_FLAG_GZIP)) == 0) {
1351 +#ifdef ARCH_FLAT_ALIGN_TEXT
1352 + printk("Unable to mmap rom with ARCH alignment requirements\n");
1357 * this should give us a ROM ptr, but if it doesn't we don't
1359 @@ -553,7 +566,7 @@ static int load_flat_file(struct linux_b
1363 - len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long);
1364 + len = data_len + extra + ALIGN(MAX_SHARED_LIBS * sizeof(unsigned long), FLAT_DATA_ALIGN);
1365 len = PAGE_ALIGN(len);
1366 down_write(¤t->mm->mmap_sem);
1367 realdatastart = do_mmap(0, 0, len,
1368 @@ -572,6 +585,7 @@ static int load_flat_file(struct linux_b
1369 datapos = ALIGN(realdatastart +
1370 MAX_SHARED_LIBS * sizeof(unsigned long),
1372 + //datapos = realdatastart + ALIGN(MAX_SHARED_LIBS * sizeof(unsigned long), ARCH_FLAT_ALIGN);
1374 DBG_FLT("BINFMT_FLAT: Allocated data+bss+stack (%d bytes): %x\n",
1375 (int)(data_len + bss_len + stack_len), (int)datapos);
1376 @@ -600,7 +614,11 @@ static int load_flat_file(struct linux_b
1380 - len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long);
1381 + len = text_len + data_len + extra + ALIGN(MAX_SHARED_LIBS * sizeof(unsigned long), FLAT_DATA_ALIGN);
1382 +#ifdef ARCH_FLAT_ALIGN_TEXT
1383 + /* Reserve space for the text alignment. */
1384 + len += FLAT_DATA_ALIGN;
1386 len = PAGE_ALIGN(len);
1387 down_write(¤t->mm->mmap_sem);
1388 textpos = do_mmap(0, 0, len,
1389 @@ -616,10 +634,17 @@ static int load_flat_file(struct linux_b
1394 +#ifdef ARCH_FLAT_ALIGN_TEXT
1395 + textpos = ALIGN(textpos + sizeof(struct flat_hdr), FLAT_DATA_ALIGN) - sizeof(struct flat_hdr);
1397 realdatastart = textpos + ntohl(hdr->data_start);
1398 datapos = ALIGN(realdatastart +
1399 MAX_SHARED_LIBS * sizeof(unsigned long),
1401 +// datapos = realdatastart + ALIGN(MAX_SHARED_LIBS * sizeof(unsigned long), ARCH_FLAT_ALIGN);
1402 +// reloc = (unsigned long *) (textpos + ntohl(hdr->reloc_start) +
1403 +// ALIGN(MAX_SHARED_LIBS * sizeof(unsigned long), ARCH_FLAT_ALIGN));
1405 reloc = (unsigned long *)
1406 (datapos + (ntohl(hdr->reloc_start) - text_len));
1407 @@ -659,7 +684,7 @@ static int load_flat_file(struct linux_b
1409 if (result >= (unsigned long)-4096) {
1410 printk("Unable to read code+data+bss, errno %d\n",(int)-result);
1411 - do_munmap(current->mm, textpos, text_len + data_len + extra +
1412 + do_munmap(current->mm, memp, text_len + data_len + extra +
1413 MAX_SHARED_LIBS * sizeof(unsigned long));
1416 @@ -672,6 +697,9 @@ static int load_flat_file(struct linux_b
1418 /* The main program needs a little extra setup in the task structure */
1419 start_code = textpos + sizeof (struct flat_hdr);
1420 +#ifdef ARCH_FLAT_ALIGN_TEXT
1421 + BUG_ON(ALIGN(start_code, FLAT_DATA_ALIGN) != start_code);
1423 end_code = textpos + text_len;
1425 current->mm->start_code = start_code;
1426 @@ -800,6 +828,13 @@ static int load_flat_file(struct linux_b
1430 + if (flush_happened) {
1432 + * The parent process has already started running. We cannot allow the child to return back to user space
1433 + * as this child is still uning the parent stack and 2 will clobber each other. We are going to kill this child.
1440 --- a/fs/Kconfig.binfmt
1441 +++ b/fs/Kconfig.binfmt
1442 @@ -30,7 +30,7 @@ config COMPAT_BINFMT_ELF
1443 config BINFMT_ELF_FDPIC
1444 bool "Kernel support for FDPIC ELF binaries"
1446 - depends on (FRV || BLACKFIN || (SUPERH32 && !MMU))
1447 + depends on (FRV || BLACKFIN || (SUPERH32 && !MMU) || UBICOM32)
1449 ELF FDPIC binaries are based on ELF, but allow the individual load
1450 segments of a binary to be located in memory independently of each
1451 --- a/include/asm-generic/resource.h
1452 +++ b/include/asm-generic/resource.h
1455 * boot-time rlimit defaults for the init task:
1457 +#ifndef CONFIG_ELF_CORE
1458 +#define CONFIG_USER_ELF_CORE_SIZE 0
1460 #define INIT_RLIMITS \
1462 [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \
1463 [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \
1464 [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \
1465 [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \
1466 - [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \
1467 + [RLIMIT_CORE] = { CONFIG_USER_ELF_CORE_SIZE, RLIM_INFINITY }, \
1468 [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \
1469 [RLIMIT_NPROC] = { 0, 0 }, \
1470 [RLIMIT_NOFILE] = { INR_OPEN, INR_OPEN }, \
1471 --- a/include/linux/elf-em.h
1472 +++ b/include/linux/elf-em.h
1474 * up with a final number.
1476 #define EM_ALPHA 0x9026
1477 +#define EM_UBICOM32 0xde3d /* Ubicom32; no ABI */
1479 /* Bogus old v850 magic number, used by old tools. */
1480 #define EM_CYGNUS_V850 0x9080
1481 --- a/include/linux/fb.h
1482 +++ b/include/linux/fb.h
1483 @@ -151,6 +151,10 @@ struct dentry;
1484 #define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
1485 #define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
1487 +#define FB_ACCEL_UBICOM32 0x0100 /* Ubicom32 */
1488 +#define FB_ACCEL_UBICOM32_VFB 0x0101 /* Ubicom32 VFB */
1489 +#define FB_ACCEL_UBICOM32_PLIO80 0x0102 /* Ubicom32 PLIO80 */
1491 struct fb_fix_screeninfo {
1492 char id[16]; /* identification string eg "TT Builtin" */
1493 unsigned long smem_start; /* Start of frame buffer mem */
1494 --- a/include/linux/if_ppp.h
1495 +++ b/include/linux/if_ppp.h
1496 @@ -114,14 +114,14 @@ struct pppol2tp_ioc_stats {
1497 __u16 tunnel_id; /* redundant */
1498 __u16 session_id; /* if zero, get tunnel stats */
1499 __u32 using_ipsec:1; /* valid only for session_id == 0 */
1500 - aligned_u64 tx_packets;
1501 - aligned_u64 tx_bytes;
1502 - aligned_u64 tx_errors;
1503 - aligned_u64 rx_packets;
1504 - aligned_u64 rx_bytes;
1505 - aligned_u64 rx_seq_discards;
1506 - aligned_u64 rx_oos_packets;
1507 - aligned_u64 rx_errors;
1513 + __u64 rx_seq_discards;
1514 + __u64 rx_oos_packets;
1518 #define ifr__name b.ifr_ifrn.ifrn_name
1519 --- a/include/linux/oprofile.h
1520 +++ b/include/linux/oprofile.h
1521 @@ -99,6 +99,8 @@ void oprofile_add_sample(struct pt_regs
1523 void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
1524 unsigned long event, int is_kernel);
1525 +void oprofile_add_ext_sample_cpu(unsigned long pc, struct pt_regs * const regs,
1526 + unsigned long event, int is_kernel, int cpu);
1528 /* Use this instead when the PC value is not from the regs. Doesn't
1530 --- a/include/linux/serial_core.h
1531 +++ b/include/linux/serial_core.h
1534 #define PORT_MAX3100 86
1537 +#define PORT_UBI32_UARTTIO 87
1541 #include <linux/compiler.h>
1542 --- a/include/linux/slab.h
1543 +++ b/include/linux/slab.h
1544 @@ -317,4 +317,14 @@ static inline void *kzalloc_node(size_t
1545 return kmalloc_node(size, flags | __GFP_ZERO, node);
1548 +struct kmem_cache_size_info {
1549 + unsigned short page;
1550 + unsigned short order;
1554 + * get info on all the memory allocated by slab for this named cache
1556 +extern int kmem_cache_block_info(char *name, struct kmem_cache_size_info *data, int max_data);
1558 #endif /* _LINUX_SLAB_H */
1561 @@ -865,6 +865,12 @@ config ELF_CORE
1563 Enable support for generating core dumps. Disabling saves about 4k.
1565 +config USER_ELF_CORE_SIZE
1566 + int "user core dump size (10MB to 32MB)"
1567 + range 10485760 33554432
1569 + depends on ELF_CORE
1571 config PCSPKR_PLATFORM
1572 bool "Enable PC-Speaker support" if EMBEDDED
1573 depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
1574 --- a/kernel/module.c
1575 +++ b/kernel/module.c
1576 @@ -2688,6 +2688,9 @@ static int m_show(struct seq_file *m, vo
1577 /* Used by oprofile and other similar tools. */
1578 seq_printf(m, " 0x%p", mod->module_core);
1580 +#ifdef ARCH_PROC_MODULES_EXTRA
1581 + ARCH_PROC_MODULES_EXTRA(m, mod);
1585 seq_printf(m, " %s", module_flags(mod, buf));
1586 @@ -2840,8 +2843,12 @@ void print_modules(void)
1587 printk("Modules linked in:");
1588 /* Most callers should already have preempt disabled, but make sure */
1590 - list_for_each_entry_rcu(mod, &modules, list)
1591 + list_for_each_entry_rcu(mod, &modules, list) {
1592 printk(" %s%s", mod->name, module_flags(mod, buf));
1593 +#ifdef ARCH_OOPS_MODULE_EXTRA
1594 + ARCH_OOPS_MODULE_EXTRA(mod);
1598 if (last_unloaded_module[0])
1599 printk(" [last unloaded: %s]", last_unloaded_module);
1600 --- a/kernel/sched_clock.c
1601 +++ b/kernel/sched_clock.c
1604 unsigned long long __attribute__((weak)) sched_clock(void)
1606 - return (unsigned long long)(jiffies - INITIAL_JIFFIES)
1607 - * (NSEC_PER_SEC / HZ);
1608 + return (get_jiffies_64() - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ);
1611 static __read_mostly int sched_clock_running;
1612 --- a/lib/Kconfig.debug
1613 +++ b/lib/Kconfig.debug
1614 @@ -621,7 +621,7 @@ config FRAME_POINTER
1615 bool "Compile the kernel with frame pointers"
1616 depends on DEBUG_KERNEL && \
1617 (CRIS || M68K || M68KNOMMU || FRV || UML || \
1618 - AVR32 || SUPERH || BLACKFIN || MN10300) || \
1619 + AVR32 || SUPERH || BLACKFIN || MN10300 || UBICOM32) || \
1620 ARCH_WANT_FRAME_POINTERS
1621 default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
1625 @@ -38,3 +38,5 @@ obj-$(CONFIG_SMP) += allocpercpu.o
1627 obj-$(CONFIG_QUICKLIST) += quicklist.o
1628 obj-$(CONFIG_CGROUP_MEM_RES_CTLR) += memcontrol.o page_cgroup.o
1630 +CFLAGS_slab.o := $(PROFILING) -O2
1633 @@ -4100,6 +4100,68 @@ out:
1635 #ifdef CONFIG_SLABINFO
1639 + * get info on all the memory allocated by slab for this named cache
1641 +int kmem_cache_block_info(char *name, struct kmem_cache_size_info *data, int max_data)
1646 + struct kmem_cache *cachep;
1647 + struct kmem_list3 *l3;
1648 + struct slab *slabp;
1650 + /* Find the cache in the chain of caches. */
1651 + mutex_lock(&cache_chain_mutex);
1652 + list_for_each_entry(cachep, &cache_chain, next) {
1653 + if (strcmp(cachep->name, name) == 0) {
1658 + mutex_unlock(&cache_chain_mutex);
1662 + for_each_online_node(node) {
1663 + l3 = cachep->nodelists[node];
1666 + if (res >= max_data)
1669 + spin_lock_irq(&l3->list_lock);
1671 + list_for_each_entry(slabp, &l3->slabs_full, list) {
1672 + if (res >= max_data)
1674 + data[res].page = ((unsigned int)slabp->s_mem >> PAGE_SHIFT) & 0xffff;
1675 + data[res].order = cachep->gfporder;
1678 + list_for_each_entry(slabp, &l3->slabs_partial, list) {
1679 + if (res >= max_data)
1681 + data[res].page = ((unsigned int)slabp->s_mem >> PAGE_SHIFT) & 0xffff;
1682 + data[res].order = cachep->gfporder;
1685 + list_for_each_entry(slabp, &l3->slabs_free, list) {
1686 + if (res >= max_data)
1688 + data[res].page = ((unsigned int)slabp->s_mem >> PAGE_SHIFT) & 0xffff;
1689 + data[res].order = cachep->gfporder;
1693 + spin_unlock_irq(&l3->list_lock);
1699 static void print_slabinfo_header(struct seq_file *m)
1702 --- a/scripts/mod/file2alias.c
1703 +++ b/scripts/mod/file2alias.c
1704 @@ -774,6 +774,15 @@ void handle_moddevtable(struct module *m
1709 + * somehow our gcc is not generating st_size correctly and set 0 for some symbols.
1710 + * and 0 size will break do_table since it adjust size to (size - id_size)
1711 + * this is to make sure st_size fall in range.
1713 + if (sym->st_size == 0 || sym->st_size > info->sechdrs[sym->st_shndx].sh_size) {
1714 + sym->st_size = info->sechdrs[sym->st_shndx].sh_size;
1717 if (sym_is(symname, "__mod_pci_device_table"))
1718 do_table(symval, sym->st_size,
1719 sizeof(struct pci_device_id), "pci",
1722 @@ -82,6 +82,8 @@ source "sound/parisc/Kconfig"
1724 source "sound/soc/Kconfig"
1726 +source "sound/ubicom32/Kconfig"
1730 menuconfig SOUND_PRIME
1731 --- a/sound/Makefile
1732 +++ b/sound/Makefile
1733 @@ -6,7 +6,7 @@ obj-$(CONFIG_SOUND_PRIME) += sound_firmw
1734 obj-$(CONFIG_SOUND_PRIME) += oss/
1735 obj-$(CONFIG_DMASOUND) += oss/
1736 obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ \
1737 - sparc/ spi/ parisc/ pcmcia/ mips/ soc/ atmel/
1738 + sparc/ spi/ parisc/ pcmcia/ mips/ soc/ atmel/ ubicom32/
1739 obj-$(CONFIG_SND_AOA) += aoa/
1741 # This one must be compilable even if sound is configured out