Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
- index b9505aa..946f302 100644
- --- a/arch/arm/kernel/head-common.S
- +++ b/arch/arm/kernel/head-common.S
- @@ -215,12 +215,14 @@ __lookup_machine_type:
- add r5, r5, r3 @ convert virt addresses to
- add r6, r6, r3 @ physical address space
- 1: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
- +/*
- teq r3, r1 @ matches loader number?
- beq 2f @ found
- add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
- cmp r5, r6
- blo 1b
- mov r5, #0 @ unknown machine
- +*/
- 2: mov pc, lr
- ENDPROC(__lookup_machine_type)
- diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
- index d49e6e6..a5b9197 100755
- --- a/arch/arm/mach-omap2/board-zoom-peripherals.c
- +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
- @@ -526,7 +526,7 @@ static int __init omap_i2c_init(void)
- prog_io |= OMAP3630_PRG_SR_PULLUPRESX;
- omap_ctrl_writel(prog_io, OMAP36XX_CONTROL_PROG_IO_WKUP1);
- }
- - omap_register_i2c_bus(1, 2400, zoom_i2c_boardinfo,
- + omap_register_i2c_bus(1, 100, zoom_i2c_boardinfo,
- ARRAY_SIZE(zoom_i2c_boardinfo));
- omap_register_i2c_bus(2, 100, zoom_i2c_boardinfo2,
- ARRAY_SIZE(zoom_i2c_boardinfo2));
- @@ -585,13 +585,13 @@ void __init zoom_peripherals_init(void * peripheral_data)
- use_generic_twl4030_script(&zoom_t2scripts_data , omap3_setuptime);
- omap_i2c_init();
- - synaptics_dev_init();
- - wlan_1273_reset();
- - omap_serial_init();
- + //synaptics_dev_init();
- + //wlan_1273_reset();
- + //omap_serial_init();
- usb_musb_init();
- - enable_board_wakeup_source();
- - platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));
- - omap_voltage_init_vc((struct prm_setup_vc *) peripheral_data);
- - zoom_cam_init();
- - omap_voltage_init_vc(omap3_setuptime);
- + //enable_board_wakeup_source();
- + //platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));
- + //omap_voltage_init_vc((struct prm_setup_vc *) peripheral_data);
- + //zoom_cam_init();
- + //omap_voltage_init_vc(omap3_setuptime);
- }
- diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
- index 063dd1a..26c0aa6 100644
- --- a/arch/arm/mach-omap2/board-zoom2.c
- +++ b/arch/arm/mach-omap2/board-zoom2.c
- @@ -154,9 +154,9 @@ static void __init omap_zoom2_init(void)
- {
- omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- zoom_peripherals_init(&omap3_setuptime_table);
- - zoom_flash_init(zoom_flash_partitions, ZOOM_NAND_CS);
- - zoom_debugboard_init();
- - zoom_display_init(OMAP_DSS_VENC_TYPE_COMPOSITE);
- + //zoom_flash_init(zoom_flash_partitions, ZOOM_NAND_CS);
- + //zoom_debugboard_init();
- + //zoom_display_init(OMAP_DSS_VENC_TYPE_COMPOSITE);
- }
- static void __init omap_zoom2_map_io(void)
- diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c
- index d5cee44..9c967d9 100644
- --- a/arch/arm/mach-omap2/board-zoom3.c
- +++ b/arch/arm/mach-omap2/board-zoom3.c
- @@ -131,9 +131,9 @@ static void __init omap_zoom_init(void)
- {
- omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
- zoom_peripherals_init(&omap3_setuptime_table);
- - zoom_flash_init(zoom_flash_partitions, ZOOM_NAND_CS);
- - zoom_debugboard_init();
- - zoom_display_init(OMAP_DSS_VENC_TYPE_COMPOSITE);
- + //zoom_flash_init(zoom_flash_partitions, ZOOM_NAND_CS);
- + //zoom_debugboard_init();
- + //zoom_display_init(OMAP_DSS_VENC_TYPE_COMPOSITE);
- }
- MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
- diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
- index 76ccc9c..7f26b16 100644
- --- a/arch/arm/mach-omap2/devices.c
- +++ b/arch/arm/mach-omap2/devices.c
- @@ -1037,9 +1037,11 @@ static inline void omap_hdq_init(void)
- static inline void omap_hdq_init(void) {}
- #endif
- +#ifdef CONFIG_PM
- struct sgx_platform_data omap_sgx_data = {
- .set_min_bus_tput = omap_pm_set_min_bus_tput,
- };
- +#endif
- static struct platform_device powervr_device = {
- .name = "pvrsrvkm",
- diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
- index ee41120..1f23411 100644
- --- a/drivers/usb/gadget/Kconfig
- +++ b/drivers/usb/gadget/Kconfig
- @@ -861,4 +861,16 @@ config USB_G_MULTI_CDC
- endchoice
- +config USB_G_SERIAL_CONSOLE
- + tristate "Serial Gadget Console Support"
- + depends on USB_G_SERIAL || USB_CDC_COMPOSITE
- + help
- + Support for console on ttyGS devices. Note this is not an
- + "early console" and since the USB system takes a while to
- + come up, this is generally not going to help debug early
- + boot oopses. However, early messages will be dumped to
- + the console if the kernel manages to stay up long enough
- + for the console to instantiate.
- +
- +
- endif # USB_GADGET
- diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
- index adf8260..d08c7e4 100644
- --- a/drivers/usb/gadget/u_serial.c
- +++ b/drivers/usb/gadget/u_serial.c
- @@ -5,6 +5,8 @@
- * Copyright (C) 2008 David Brownell
- * Copyright (C) 2008 by Nokia Corporation
- *
- + * Console support Copyright (C) 2010 Brian S. Julin (bri at abrij.org)
- + *
- * This code also borrows from usbserial.c, which is
- * Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com)
- * Copyright (C) 2000 Peter Berger (pberger@brimson.com)
- @@ -24,6 +26,8 @@
- #include <linux/tty.h>
- #include <linux/tty_flip.h>
- +#include <linux/console.h>
- +
- #include "u_serial.h"
- @@ -92,7 +96,11 @@ struct gs_buf {
- */
- struct gs_port {
- spinlock_t port_lock; /* guard port_* access */
- +#ifdef CONFIG_USB_G_SERIAL_CONSOLE
- + int stole_lock; /* for console oopses */
- + struct console port_console;
- +#endif
- struct gserial *port_usb;
- struct tty_struct *port_tty;
- @@ -389,7 +397,7 @@ __acquires(&port->port_lock)
- spin_lock(&port->port_lock);
- if (status) {
- - pr_debug("%s: %s %s err %d\n",
- + pr_vdebug("%s: %s %s err %d\n",
- __func__, "queue", in->name, status);
- list_add(&req->list, pool);
- break;
- @@ -440,7 +448,7 @@ __acquires(&port->port_lock)
- spin_lock(&port->port_lock);
- if (status) {
- - pr_debug("%s: %s %s err %d\n",
- + pr_vdebug("%s: %s %s err %d\n",
- __func__, "queue", out->name, status);
- list_add(&req->list, pool);
- break;
- @@ -681,12 +689,14 @@ static int gs_start_io(struct gs_port *port)
- started = gs_start_rx(port);
- /* unblock any pending writes into our circular buffer */
- - if (started) {
- - tty_wakeup(port->port_tty);
- - } else {
- - gs_free_requests(ep, head);
- - gs_free_requests(port->port_usb->in, &port->write_pool);
- - status = -EIO;
- + if (port->port_tty) {
- + if (started) {
- + tty_wakeup(port->port_tty);
- + } else {
- + gs_free_requests(ep, head);
- + gs_free_requests(port->port_usb->in, &port->write_pool);
- + status = -EIO;
- + }
- }
- return status;
- @@ -764,7 +774,7 @@ static int gs_open(struct tty_struct *tty, struct file *file)
- spin_lock_irq(&port->port_lock);
- if (status) {
- - pr_debug("gs_open: ttyGS%d (%p,%p) no buffer\n",
- + pr_vdebug("gs_open: ttyGS%d (%p,%p) no buffer\n",
- port->port_num, tty, file);
- port->openclose = false;
- goto exit_unlock_port;
- @@ -792,14 +802,14 @@ static int gs_open(struct tty_struct *tty, struct file *file)
- if (port->port_usb) {
- struct gserial *gser = port->port_usb;
- - pr_debug("gs_open: start ttyGS%d\n", port->port_num);
- + pr_vdebug("gs_open: start ttyGS%d\n", port->port_num);
- gs_start_io(port);
- if (gser->connect)
- gser->connect(gser);
- }
- - pr_debug("gs_open: ttyGS%d (%p,%p)\n", port->port_num, tty, file);
- + pr_vdebug("gs_open: ttyGS%d (%p,%p)\n", port->port_num, tty, file);
- status = 0;
- @@ -835,7 +845,7 @@ static void gs_close(struct tty_struct *tty, struct file *file)
- goto exit;
- }
- - pr_debug("gs_close: ttyGS%d (%p,%p) ...\n", port->port_num, tty, file);
- + pr_vdebug("gs_close: ttyGS%d (%p,%p) ...\n", port->port_num, tty, file);
- /* mark port as closing but in use; we can drop port lock
- * and sleep if necessary
- @@ -873,7 +883,7 @@ static void gs_close(struct tty_struct *tty, struct file *file)
- port->openclose = false;
- - pr_debug("gs_close: ttyGS%d (%p,%p) done!\n",
- + pr_vdebug("gs_close: ttyGS%d (%p,%p) done!\n",
- port->port_num, tty, file);
- wake_up_interruptible(&port->close_wait);
- @@ -901,6 +911,88 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count)
- return count;
- }
- +#ifdef CONFIG_USB_G_SERIAL_CONSOLE
- +/* This stolen/adapted from serial/sn_console.c */
- +static void gs_console_write(struct console *cons, const char *buf, unsigned count)
- +{
- + unsigned long flags = 0;
- + unsigned status;
- + struct gs_port *port;
- +
- + port = cons->data;
- +
- + /* Just chuck everything if USB side is not up. */
- + if (!port->port_usb) return;
- +
- + /* somebody really wants this output, might be an
- + * oops, kdb, panic, etc. make sure they get it. */
- + if (spin_is_locked(&port->port_lock)) {
- + char *get = port->port_write_buf.buf_get;
- + char *put = port->port_write_buf.buf_put;
- + int got_lock = 0;
- + int counter;
- +
- + /*
- + * We attempt to determine if someone has died with the
- + * lock. We wait ~20 secs after the head and tail ptrs
- + * stop moving and assume the lock holder is not functional
- + * and plow ahead. If the lock is freed within the time out
- + * period we re-get the lock and go ahead normally. We also
- + * remember if we have plowed ahead so that we don't have
- + * to wait out the time out period again - the asumption
- + * is that we will time out again.
- + */
- + for (counter = 0; counter < 150; mdelay(125), counter++) {
- + if (!spin_is_locked(&port->port_lock) || port->stole_lock) {
- + if (!port->stole_lock)
- + break;
- + spin_lock_irqsave(&port->port_lock, flags);
- + got_lock = 1;
- + break;
- + }
- + /* still locked */
- + if ((get != port->port_write_buf.buf_get)
- + || (put != port->port_write_buf.buf_put)) {
- + put = port->port_write_buf.buf_put;
- + get = port->port_write_buf.buf_get;
- + counter = 0;
- + }
- + }
- + /* Make space by flushing any waiting output */
- + if (port->port_usb)
- + gs_start_tx(port);
- + while (count) {
- + count -= gs_buf_put(&port->port_write_buf, buf, count);
- + if (port->port_usb) break;
- + /* Flush our stuff immediately */
- + if (!gs_start_tx(port))
- + mdelay(125);
- + }
- + if (got_lock) {
- + spin_unlock_irqrestore(&port->port_lock, flags);
- + port->stole_lock = 0;
- + } else {
- + /* fell thru */
- + port->stole_lock = 1;
- + }
- + return;
- + }
- + port->stole_lock = 0;
- + spin_lock_irqsave(&port->port_lock, flags);
- + /* Flush out any waiting output so we have as much space as possible */
- + if (port->port_usb)
- + status = gs_start_tx(port);
- + while (count) {
- + count -= gs_buf_put(&port->port_write_buf, buf, count);
- + if (port->port_usb) break;
- + /* Flush our stuff immediately */
- + if (!gs_start_tx(port))
- + mdelay(125);
- + }
- + spin_unlock_irqrestore(&port->port_lock, flags);
- +}
- +#endif
- +
- static int gs_put_char(struct tty_struct *tty, unsigned char ch)
- {
- struct gs_port *port = tty->driver_data;
- @@ -1015,6 +1107,47 @@ static const struct tty_operations gs_tty_ops = {
- static struct tty_driver *gs_tty_driver;
- +#ifdef CONFIG_USB_G_SERIAL_CONSOLE
- +struct tty_driver *gs_console_device(struct console *cons, int *gidx)
- +{
- + struct gs_port *port;
- + port = container_of(cons, struct gs_port, port_console);
- + if (gidx)
- + *gidx = port->port_num;
- + return gs_tty_driver;
- +}
- +
- +static int gs_console_setup (struct console *cons, char *options)
- +{
- + struct gs_port *port;
- + int status = 0;
- +
- + /*
- + * If this is called we are about to become the active console. (?)
- + *
- + * That is not what this hook is for, but it serves our purposes.
- + *
- + * Since there is no actual tty yet, we have to do some of what is
- + * normally done in gs_open.
- + */
- + port = container_of(cons, struct gs_port, port_console);
- + if (port->port_write_buf.buf_buf == NULL) {
- + status = gs_buf_alloc(&port->port_write_buf, WRITE_BUF_SIZE);
- + }
- +
- + /* Start the I/O stream */
- + if (port->port_usb) {
- + struct gserial *gser = port->port_usb;
- +
- + gs_start_io(port);
- +
- + if (gser->connect)
- + gser->connect(gser);
- + }
- + return status;
- +}
- +#endif
- +
- static int __init
- gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding)
- {
- @@ -1129,10 +1262,25 @@ int __init gserial_setup(struct usb_gadget *g, unsigned count)
- __func__, i, PTR_ERR(tty_dev));
- }
- - pr_debug("%s: registered %d ttyGS* device%s\n", __func__,
- + pr_vdebug("%s: registered %d ttyGS* device%s\n", __func__,
- count, (count == 1) ? "" : "s");
- return status;
- +#ifdef CONFIG_USB_G_SERIAL_CONSOLE
- + for (i = 0; i < count; i++) {
- + struct gs_port *p;
- +
- + p = ports[i].port;
- + strcpy(p->port_console.name, PREFIX);
- + p->port_console.write = gs_console_write;
- + p->port_console.device = gs_console_device;
- + p->port_console.setup = gs_console_setup;
- + p->port_console.flags = CON_PRINTBUFFER | CON_ENABLED;
- + p->port_console.index = p->port_num;
- + p->port_console.data = p;
- + register_console(&p->port_console);
- + }
- +#endif
- fail:
- while (count--)
- kfree(ports[count].port);
- @@ -1179,6 +1327,10 @@ void gserial_cleanup(void)
- /* prevent new opens */
- mutex_lock(&ports[i].lock);
- port = ports[i].port;
- +
- +#ifdef CONFIG_USB_G_SERIAL_CONSOLE
- + unregister_console(&port->port_console);
- +#endif
- ports[i].port = NULL;
- mutex_unlock(&ports[i].lock);
- @@ -1196,7 +1348,7 @@ void gserial_cleanup(void)
- tty_unregister_driver(gs_tty_driver);
- gs_tty_driver = NULL;
- - pr_debug("%s: cleaned up ttyGS* support\n", __func__);
- + pr_vdebug("%s: cleaned up ttyGS* support\n", __func__);
- }
- /**
- @@ -1259,7 +1411,7 @@ int gserial_connect(struct gserial *gser, u8 port_num)
- * protocol about open/close status (connect/disconnect).
- */
- if (port->open_count) {
- - pr_debug("gserial_connect: start ttyGS%d\n", port->port_num);
- + pr_vdebug("gserial_connect: start ttyGS%d\n", port->port_num);
- gs_start_io(port);
- if (gser->connect)
- gser->connect(gser);
- @@ -1269,7 +1421,6 @@ int gserial_connect(struct gserial *gser, u8 port_num)
- }
- spin_unlock_irqrestore(&port->port_lock, flags);
- -
- return status;
- fail_out:
- @@ -1312,6 +1463,7 @@ void gserial_disconnect(struct gserial *gser)
- }
- spin_unlock_irqrestore(&port->port_lock, flags);
- +
- /* disable endpoints, aborting down any active I/O */
- usb_ep_disable(gser->out);
- gser->out->driver_data = NULL;
- diff --git a/kernel/panic.c b/kernel/panic.c
- index 96b45d0..cf4f616 100644
- --- a/kernel/panic.c
- +++ b/kernel/panic.c
- @@ -29,7 +29,7 @@ static int pause_on_oops;
- static int pause_on_oops_flag;
- static DEFINE_SPINLOCK(pause_on_oops_lock);
- -int panic_timeout;
- +int panic_timeout=10;
- ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
- @@ -100,9 +100,11 @@ NORET_TYPE void panic(const char * fmt, ...)
- * Delay timeout seconds before rebooting the machine.
- * We can't use the "normal" timers since we just panicked.
- */
- - printk(KERN_EMERG "Rebooting in %d seconds..", panic_timeout);
- for (i = 0; i < panic_timeout*1000; ) {
- + printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
- + printk(KERN_EMERG "Rebooting in %d seconds..", panic_timeout);
- +
- touch_nmi_watchdog();
- i += panic_blink(i);
- mdelay(1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement