Merge commit 'v2.6.37-rc7' into perf/core

Merge reason: Pick up the latest -rc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Ingo Molnar 2010-12-22 11:53:20 +01:00
commit 6c529a266b
441 changed files with 4236 additions and 3160 deletions

View File

@ -173,12 +173,13 @@ prototypes:
sector_t (*bmap)(struct address_space *, sector_t); sector_t (*bmap)(struct address_space *, sector_t);
int (*invalidatepage) (struct page *, unsigned long); int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int); int (*releasepage) (struct page *, int);
void (*freepage)(struct page *);
int (*direct_IO)(int, struct kiocb *, const struct iovec *iov, int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
loff_t offset, unsigned long nr_segs); loff_t offset, unsigned long nr_segs);
int (*launder_page) (struct page *); int (*launder_page) (struct page *);
locking rules: locking rules:
All except set_page_dirty may block All except set_page_dirty and freepage may block
BKL PageLocked(page) i_mutex BKL PageLocked(page) i_mutex
writepage: no yes, unlocks (see below) writepage: no yes, unlocks (see below)
@ -193,6 +194,7 @@ perform_write: no n/a yes
bmap: no bmap: no
invalidatepage: no yes invalidatepage: no yes
releasepage: no yes releasepage: no yes
freepage: no yes
direct_IO: no direct_IO: no
launder_page: no yes launder_page: no yes
@ -288,6 +290,9 @@ buffers from the page in preparation for freeing it. It returns zero to
indicate that the buffers are (or may be) freeable. If ->releasepage is zero, indicate that the buffers are (or may be) freeable. If ->releasepage is zero,
the kernel assumes that the fs has no private interest in the buffers. the kernel assumes that the fs has no private interest in the buffers.
->freepage() is called when the kernel is done dropping the page
from the page cache.
->launder_page() may be called prior to releasing a page if ->launder_page() may be called prior to releasing a page if
it is still found to be dirty. It returns zero if the page was successfully it is still found to be dirty. It returns zero if the page was successfully
cleaned, or an error value if not. Note that in order to prevent the page cleaned, or an error value if not. Note that in order to prevent the page

View File

@ -534,6 +534,7 @@ struct address_space_operations {
sector_t (*bmap)(struct address_space *, sector_t); sector_t (*bmap)(struct address_space *, sector_t);
int (*invalidatepage) (struct page *, unsigned long); int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int); int (*releasepage) (struct page *, int);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
loff_t offset, unsigned long nr_segs); loff_t offset, unsigned long nr_segs);
struct page* (*get_xip_page)(struct address_space *, sector_t, struct page* (*get_xip_page)(struct address_space *, sector_t,
@ -678,6 +679,12 @@ struct address_space_operations {
need to ensure this. Possibly it can clear the PageUptodate need to ensure this. Possibly it can clear the PageUptodate
bit if it cannot free private data yet. bit if it cannot free private data yet.
freepage: freepage is called once the page is no longer visible in
the page cache in order to allow the cleanup of any private
data. Since it may be called by the memory reclaimer, it
should not assume that the original address_space mapping still
exists, and it should not block.
direct_IO: called by the generic read/write routines to perform direct_IO: called by the generic read/write routines to perform
direct_IO - that is IO requests which bypass the page cache direct_IO - that is IO requests which bypass the page cache
and transfer data directly between the storage and the and transfer data directly between the storage and the

View File

@ -2167,11 +2167,6 @@ and is between 256 and 4096 characters. It is defined in the file
reset_devices [KNL] Force drivers to reset the underlying device reset_devices [KNL] Force drivers to reset the underlying device
during initialization. during initialization.
resource_alloc_from_bottom
Allocate new resources from the beginning of available
space, not the end. If you need to use this, please
report a bug.
resume= [SWSUSP] resume= [SWSUSP]
Specify the partition device for software suspend Specify the partition device for software suspend

View File

@ -379,8 +379,8 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
zero) zero)
bool pm_runtime_suspended(struct device *dev); bool pm_runtime_suspended(struct device *dev);
- return true if the device's runtime PM status is 'suspended', or false - return true if the device's runtime PM status is 'suspended' and its
otherwise 'power.disable_depth' field is equal to zero, or false otherwise
void pm_runtime_allow(struct device *dev); void pm_runtime_allow(struct device *dev);
- set the power.runtime_auto flag for the device and decrease its usage - set the power.runtime_auto flag for the device and decrease its usage

View File

@ -559,14 +559,14 @@ W: http://maxim.org.za/at91_26.html
S: Maintained S: Maintained
ARM/BCMRING ARM ARCHITECTURE ARM/BCMRING ARM ARCHITECTURE
M: Leo Chen <leochen@broadcom.com> M: Jiandong Zheng <jdzheng@broadcom.com>
M: Scott Branden <sbranden@broadcom.com> M: Scott Branden <sbranden@broadcom.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: arch/arm/mach-bcmring F: arch/arm/mach-bcmring
ARM/BCMRING MTD NAND DRIVER ARM/BCMRING MTD NAND DRIVER
M: Leo Chen <leochen@broadcom.com> M: Jiandong Zheng <jdzheng@broadcom.com>
M: Scott Branden <sbranden@broadcom.com> M: Scott Branden <sbranden@broadcom.com>
L: linux-mtd@lists.infradead.org L: linux-mtd@lists.infradead.org
S: Maintained S: Maintained
@ -815,7 +815,7 @@ F: drivers/mmc/host/msm_sdcc.c
F: drivers/mmc/host/msm_sdcc.h F: drivers/mmc/host/msm_sdcc.h
F: drivers/serial/msm_serial.h F: drivers/serial/msm_serial.h
F: drivers/serial/msm_serial.c F: drivers/serial/msm_serial.c
T: git git://codeaurora.org/quic/kernel/dwalker/linux-msm.git T: git git://codeaurora.org/quic/kernel/davidb/linux-msm.git
S: Maintained S: Maintained
ARM/TOSA MACHINE SUPPORT ARM/TOSA MACHINE SUPPORT
@ -5932,7 +5932,6 @@ F: include/linux/tty.h
TULIP NETWORK DRIVERS TULIP NETWORK DRIVERS
M: Grant Grundler <grundler@parisc-linux.org> M: Grant Grundler <grundler@parisc-linux.org>
M: Kyle McMartin <kyle@mcmartin.ca>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Maintained S: Maintained
F: drivers/net/tulip/ F: drivers/net/tulip/
@ -6584,6 +6583,15 @@ F: include/linux/mfd/wm8400*
F: include/sound/wm????.h F: include/sound/wm????.h
F: sound/soc/codecs/wm* F: sound/soc/codecs/wm*
WORKQUEUE
M: Tejun Heo <tj@kernel.org>
L: linux-kernel@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git
S: Maintained
F: include/linux/workqueue.h
F: kernel/workqueue.c
F: Documentation/workqueue.txt
X.25 NETWORK LAYER X.25 NETWORK LAYER
M: Andrew Hendry <andrew.hendry@gmail.com> M: Andrew Hendry <andrew.hendry@gmail.com>
L: linux-x25@vger.kernel.org L: linux-x25@vger.kernel.org

View File

@ -1,7 +1,7 @@
VERSION = 2 VERSION = 2
PATCHLEVEL = 6 PATCHLEVEL = 6
SUBLEVEL = 37 SUBLEVEL = 37
EXTRAVERSION = -rc5 EXTRAVERSION = -rc7
NAME = Flesh-Eating Bats with Fangs NAME = Flesh-Eating Bats with Fangs
# *DOCUMENTATION* # *DOCUMENTATION*

View File

@ -1311,7 +1311,7 @@ config HZ
config THUMB2_KERNEL config THUMB2_KERNEL
bool "Compile the kernel in Thumb-2 mode" bool "Compile the kernel in Thumb-2 mode"
depends on CPU_V7 && EXPERIMENTAL depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL
select AEABI select AEABI
select ARM_ASM_UNIFIED select ARM_ASM_UNIFIED
help help
@ -1759,7 +1759,7 @@ comment "At least one emulation must be selected"
config FPE_NWFPE config FPE_NWFPE
bool "NWFPE math emulation" bool "NWFPE math emulation"
depends on !AEABI || OABI_COMPAT depends on (!AEABI || OABI_COMPAT) && !THUMB2_KERNEL
---help--- ---help---
Say Y to include the NWFPE floating point emulator in the kernel. Say Y to include the NWFPE floating point emulator in the kernel.
This is necessary to run most binaries. Linux does not currently This is necessary to run most binaries. Linux does not currently

View File

@ -65,7 +65,7 @@ obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o
obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o
obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o
obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o
obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o
# AT91SAM9260/AT91SAM9G20 board-specific support # AT91SAM9260/AT91SAM9G20 board-specific support
obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o

View File

@ -31,6 +31,7 @@
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91sam9_smc.h> #include <mach/at91sam9_smc.h>
#include <mach/stamp9g20.h>
#include "sam9_smc.h" #include "sam9_smc.h"
#include "generic.h" #include "generic.h"
@ -38,11 +39,7 @@
static void __init pcontrol_g20_map_io(void) static void __init pcontrol_g20_map_io(void)
{ {
/* Initialize processor: 18.432 MHz crystal */ stamp9g20_map_io();
at91sam9260_initialize(18432000);
/* DGBU on ttyS0. (Rx, Tx) only TTL -> JTAG connector X7 17,19 ) */
at91_register_uart(0, 0, 0);
/* USART0 on ttyS1. (Rx, Tx, CTS, RTS) piggyback A2 */ /* USART0 on ttyS1. (Rx, Tx, CTS, RTS) piggyback A2 */
at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS
@ -54,9 +51,6 @@ static void __init pcontrol_g20_map_io(void)
/* USART2 on ttyS3. (Rx, Tx) 9bit-Bus Multidrop-mode X4 */ /* USART2 on ttyS3. (Rx, Tx) 9bit-Bus Multidrop-mode X4 */
at91_register_uart(AT91SAM9260_ID_US4, 3, 0); at91_register_uart(AT91SAM9260_ID_US4, 3, 0);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
} }
@ -66,38 +60,6 @@ static void __init init_irq(void)
} }
/*
* NAND flash 512MiB 1,8V 8-bit, sector size 128 KiB
*/
static struct atmel_nand_data __initdata nand_data = {
.ale = 21,
.cle = 22,
.rdy_pin = AT91_PIN_PC13,
.enable_pin = AT91_PIN_PC14,
};
/*
* Bus timings; unit = 7.57ns
*/
static struct sam9_smc_config __initdata nand_smc_config = {
.ncs_read_setup = 0,
.nrd_setup = 2,
.ncs_write_setup = 0,
.nwe_setup = 2,
.ncs_read_pulse = 4,
.nrd_pulse = 4,
.ncs_write_pulse = 4,
.nwe_pulse = 4,
.read_cycle = 7,
.write_cycle = 7,
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE
| AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
.tdf_cycles = 3,
};
static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { { static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { {
.ncs_read_setup = 16, .ncs_read_setup = 16,
.nrd_setup = 18, .nrd_setup = 18,
@ -138,14 +100,6 @@ static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { {
.tdf_cycles = 1, .tdf_cycles = 1,
} }; } };
static void __init add_device_nand(void)
{
/* configure chip-select 3 (NAND) */
sam9_smc_configure(3, &nand_smc_config);
at91_add_device_nand(&nand_data);
}
static void __init add_device_pcontrol(void) static void __init add_device_pcontrol(void)
{ {
/* configure chip-select 4 (IO compatible to 8051 X4 ) */ /* configure chip-select 4 (IO compatible to 8051 X4 ) */
@ -155,23 +109,6 @@ static void __init add_device_pcontrol(void)
} }
/*
* MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected
*/
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
static struct mci_platform_data __initdata mmc_data = {
.slot[0] = {
.bus_width = 4,
},
};
#else
static struct at91_mmc_data __initdata mmc_data = {
.wire4 = 1,
};
#endif
/* /*
* USB Host port * USB Host port
*/ */
@ -265,42 +202,13 @@ static struct spi_board_info pcontrol_g20_spi_devices[] = {
}; };
/*
* Dallas 1-Wire DS2431
*/
static struct w1_gpio_platform_data w1_gpio_pdata = {
.pin = AT91_PIN_PA29,
.is_open_drain = 1,
};
static struct platform_device w1_device = {
.name = "w1-gpio",
.id = -1,
.dev.platform_data = &w1_gpio_pdata,
};
static void add_wire1(void)
{
at91_set_GPIO_periph(w1_gpio_pdata.pin, 1);
at91_set_multi_drive(w1_gpio_pdata.pin, 1);
platform_device_register(&w1_device);
}
static void __init pcontrol_g20_board_init(void) static void __init pcontrol_g20_board_init(void)
{ {
at91_add_device_serial(); stamp9g20_board_init();
add_device_nand();
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
at91_add_device_mci(0, &mmc_data);
#else
at91_add_device_mmc(0, &mmc_data);
#endif
at91_add_device_usbh(&usbh_data); at91_add_device_usbh(&usbh_data);
at91_add_device_eth(&macb_data); at91_add_device_eth(&macb_data);
at91_add_device_i2c(pcontrol_g20_i2c_devices, at91_add_device_i2c(pcontrol_g20_i2c_devices,
ARRAY_SIZE(pcontrol_g20_i2c_devices)); ARRAY_SIZE(pcontrol_g20_i2c_devices));
add_wire1();
add_device_pcontrol(); add_device_pcontrol();
at91_add_device_spi(pcontrol_g20_spi_devices, at91_add_device_spi(pcontrol_g20_spi_devices,
ARRAY_SIZE(pcontrol_g20_spi_devices)); ARRAY_SIZE(pcontrol_g20_spi_devices));

View File

@ -32,7 +32,7 @@
#include "generic.h" #include "generic.h"
static void __init portuxg20_map_io(void) void __init stamp9g20_map_io(void)
{ {
/* Initialize processor: 18.432 MHz crystal */ /* Initialize processor: 18.432 MHz crystal */
at91sam9260_initialize(18432000); at91sam9260_initialize(18432000);
@ -40,6 +40,24 @@ static void __init portuxg20_map_io(void)
/* DGBU on ttyS0. (Rx & Tx only) */ /* DGBU on ttyS0. (Rx & Tx only) */
at91_register_uart(0, 0, 0); at91_register_uart(0, 0, 0);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
}
static void __init stamp9g20evb_map_io(void)
{
stamp9g20_map_io();
/* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
| ATMEL_UART_DTR | ATMEL_UART_DSR
| ATMEL_UART_DCD | ATMEL_UART_RI);
}
static void __init portuxg20_map_io(void)
{
stamp9g20_map_io();
/* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
| ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DTR | ATMEL_UART_DSR
@ -56,26 +74,6 @@ static void __init portuxg20_map_io(void)
/* USART5 on ttyS6. (Rx, Tx only) */ /* USART5 on ttyS6. (Rx, Tx only) */
at91_register_uart(AT91SAM9260_ID_US5, 6, 0); at91_register_uart(AT91SAM9260_ID_US5, 6, 0);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
}
static void __init stamp9g20_map_io(void)
{
/* Initialize processor: 18.432 MHz crystal */
at91sam9260_initialize(18432000);
/* DGBU on ttyS0. (Rx & Tx only) */
at91_register_uart(0, 0, 0);
/* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
| ATMEL_UART_DTR | ATMEL_UART_DSR
| ATMEL_UART_DCD | ATMEL_UART_RI);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
} }
static void __init init_irq(void) static void __init init_irq(void)
@ -156,7 +154,7 @@ static struct at91_udc_data __initdata portuxg20_udc_data = {
.pullup_pin = 0, /* pull-up driven by UDC */ .pullup_pin = 0, /* pull-up driven by UDC */
}; };
static struct at91_udc_data __initdata stamp9g20_udc_data = { static struct at91_udc_data __initdata stamp9g20evb_udc_data = {
.vbus_pin = AT91_PIN_PA22, .vbus_pin = AT91_PIN_PA22,
.pullup_pin = 0, /* pull-up driven by UDC */ .pullup_pin = 0, /* pull-up driven by UDC */
}; };
@ -190,7 +188,7 @@ static struct gpio_led portuxg20_leds[] = {
} }
}; };
static struct gpio_led stamp9g20_leds[] = { static struct gpio_led stamp9g20evb_leds[] = {
{ {
.name = "D8", .name = "D8",
.gpio = AT91_PIN_PB18, .gpio = AT91_PIN_PB18,
@ -250,7 +248,7 @@ void add_w1(void)
} }
static void __init generic_board_init(void) void __init stamp9g20_board_init(void)
{ {
/* Serial */ /* Serial */
at91_add_device_serial(); at91_add_device_serial();
@ -262,34 +260,40 @@ static void __init generic_board_init(void)
#else #else
at91_add_device_mmc(0, &mmc_data); at91_add_device_mmc(0, &mmc_data);
#endif #endif
/* USB Host */
at91_add_device_usbh(&usbh_data);
/* Ethernet */
at91_add_device_eth(&macb_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* W1 */ /* W1 */
add_w1(); add_w1();
} }
static void __init portuxg20_board_init(void) static void __init portuxg20_board_init(void)
{ {
generic_board_init(); stamp9g20_board_init();
/* SPI */ /* USB Host */
at91_add_device_spi(portuxg20_spi_devices, ARRAY_SIZE(portuxg20_spi_devices)); at91_add_device_usbh(&usbh_data);
/* USB Device */ /* USB Device */
at91_add_device_udc(&portuxg20_udc_data); at91_add_device_udc(&portuxg20_udc_data);
/* Ethernet */
at91_add_device_eth(&macb_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* SPI */
at91_add_device_spi(portuxg20_spi_devices, ARRAY_SIZE(portuxg20_spi_devices));
/* LEDs */ /* LEDs */
at91_gpio_leds(portuxg20_leds, ARRAY_SIZE(portuxg20_leds)); at91_gpio_leds(portuxg20_leds, ARRAY_SIZE(portuxg20_leds));
} }
static void __init stamp9g20_board_init(void) static void __init stamp9g20evb_board_init(void)
{ {
generic_board_init(); stamp9g20_board_init();
/* USB Host */
at91_add_device_usbh(&usbh_data);
/* USB Device */ /* USB Device */
at91_add_device_udc(&stamp9g20_udc_data); at91_add_device_udc(&stamp9g20evb_udc_data);
/* Ethernet */
at91_add_device_eth(&macb_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* LEDs */ /* LEDs */
at91_gpio_leds(stamp9g20_leds, ARRAY_SIZE(stamp9g20_leds)); at91_gpio_leds(stamp9g20evb_leds, ARRAY_SIZE(stamp9g20evb_leds));
} }
MACHINE_START(PORTUXG20, "taskit PortuxG20") MACHINE_START(PORTUXG20, "taskit PortuxG20")
@ -305,7 +309,7 @@ MACHINE_START(STAMP9G20, "taskit Stamp9G20")
/* Maintainer: taskit GmbH */ /* Maintainer: taskit GmbH */
.boot_params = AT91_SDRAM_BASE + 0x100, .boot_params = AT91_SDRAM_BASE + 0x100,
.timer = &at91sam926x_timer, .timer = &at91sam926x_timer,
.map_io = stamp9g20_map_io, .map_io = stamp9g20evb_map_io,
.init_irq = init_irq, .init_irq = init_irq,
.init_machine = stamp9g20_board_init, .init_machine = stamp9g20evb_board_init,
MACHINE_END MACHINE_END

View File

@ -658,7 +658,7 @@ static void __init at91_upll_usbfs_clock_init(unsigned long main_clock)
/* Now set uhpck values */ /* Now set uhpck values */
uhpck.parent = &utmi_clk; uhpck.parent = &utmi_clk;
uhpck.pmc_mask = AT91SAM926x_PMC_UHP; uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
uhpck.rate_hz = utmi_clk.parent->rate_hz; uhpck.rate_hz = utmi_clk.rate_hz;
uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8); uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8);
} }

View File

@ -0,0 +1,7 @@
#ifndef __MACH_STAMP9G20_H
#define __MACH_STAMP9G20_H
void stamp9g20_map_io(void);
void stamp9g20_board_init(void);
#endif

View File

@ -126,7 +126,6 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000); static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
static APBC_CLK(rtc, MMP2_RTC, 0, 32768);
static APMU_CLK(nand, NAND, 0xbf, 100000000); static APMU_CLK(nand, NAND, 0xbf, 100000000);

View File

@ -216,7 +216,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
{ {
.name = "wl1271", .name = "wl1271",
.mmc = 3, .mmc = 3,
.caps = MMC_CAP_4_BIT_DATA, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.nonremovable = true, .nonremovable = true,

View File

@ -297,7 +297,7 @@ static int __init _omap2_init_reprogram_sdrc(void)
return 0; return 0;
dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck");
if (!dpll3_m2_ck) if (IS_ERR(dpll3_m2_ck))
return -EINVAL; return -EINVAL;
rate = clk_get_rate(dpll3_m2_ck); rate = clk_get_rate(dpll3_m2_ck);

View File

@ -161,6 +161,23 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val); printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val);
} }
void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
{
u32 tick_rate, cycles;
if (!seconds && !milliseconds)
return;
tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
omap_dm_timer_stop(gptimer_wakeup);
omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles);
pr_info("PM: Resume timer in %u.%03u secs"
" (%d ticks at %d ticks/sec.)\n",
seconds, milliseconds, cycles, tick_rate);
}
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
@ -354,23 +371,6 @@ void pm_dbg_update_time(struct powerdomain *pwrdm, int prev)
pwrdm->timer = t; pwrdm->timer = t;
} }
void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
{
u32 tick_rate, cycles;
if (!seconds && !milliseconds)
return;
tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
omap_dm_timer_stop(gptimer_wakeup);
omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles);
pr_info("PM: Resume timer in %u.%03u secs"
" (%d ticks at %d ticks/sec.)\n",
seconds, milliseconds, cycles, tick_rate);
}
static int clkdm_dbg_show_counter(struct clockdomain *clkdm, void *user) static int clkdm_dbg_show_counter(struct clockdomain *clkdm, void *user)
{ {
struct seq_file *s = (struct seq_file *)user; struct seq_file *s = (struct seq_file *)user;

View File

@ -53,6 +53,19 @@
#include <plat/powerdomain.h> #include <plat/powerdomain.h>
#include <plat/clockdomain.h> #include <plat/clockdomain.h>
#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state = PM_SUSPEND_ON;
static inline bool is_suspending(void)
{
return (suspend_state != PM_SUSPEND_ON);
}
#else
static inline bool is_suspending(void)
{
return false;
}
#endif
static void (*omap2_sram_idle)(void); static void (*omap2_sram_idle)(void);
static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
void __iomem *sdrc_power); void __iomem *sdrc_power);
@ -120,8 +133,9 @@ static void omap2_enter_full_retention(void)
goto no_sleep; goto no_sleep;
/* Block console output in case it is on one of the OMAP UARTs */ /* Block console output in case it is on one of the OMAP UARTs */
if (try_acquire_console_sem()) if (!is_suspending())
goto no_sleep; if (try_acquire_console_sem())
goto no_sleep;
omap_uart_prepare_idle(0); omap_uart_prepare_idle(0);
omap_uart_prepare_idle(1); omap_uart_prepare_idle(1);
@ -136,7 +150,8 @@ static void omap2_enter_full_retention(void)
omap_uart_resume_idle(1); omap_uart_resume_idle(1);
omap_uart_resume_idle(0); omap_uart_resume_idle(0);
release_console_sem(); if (!is_suspending())
release_console_sem();
no_sleep: no_sleep:
if (omap2_pm_debug) { if (omap2_pm_debug) {
@ -284,6 +299,12 @@ static void omap2_pm_idle(void)
local_irq_enable(); local_irq_enable();
} }
static int omap2_pm_begin(suspend_state_t state)
{
suspend_state = state;
return 0;
}
static int omap2_pm_prepare(void) static int omap2_pm_prepare(void)
{ {
/* We cannot sleep in idle until we have resumed */ /* We cannot sleep in idle until we have resumed */
@ -333,10 +354,17 @@ static void omap2_pm_finish(void)
enable_hlt(); enable_hlt();
} }
static void omap2_pm_end(void)
{
suspend_state = PM_SUSPEND_ON;
}
static struct platform_suspend_ops omap_pm_ops = { static struct platform_suspend_ops omap_pm_ops = {
.begin = omap2_pm_begin,
.prepare = omap2_pm_prepare, .prepare = omap2_pm_prepare,
.enter = omap2_pm_enter, .enter = omap2_pm_enter,
.finish = omap2_pm_finish, .finish = omap2_pm_finish,
.end = omap2_pm_end,
.valid = suspend_valid_only_mem, .valid = suspend_valid_only_mem,
}; };

View File

@ -50,6 +50,19 @@
#include "sdrc.h" #include "sdrc.h"
#include "control.h" #include "control.h"
#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state = PM_SUSPEND_ON;
static inline bool is_suspending(void)
{
return (suspend_state != PM_SUSPEND_ON);
}
#else
static inline bool is_suspending(void)
{
return false;
}
#endif
/* Scratchpad offsets */ /* Scratchpad offsets */
#define OMAP343X_TABLE_ADDRESS_OFFSET 0xc4 #define OMAP343X_TABLE_ADDRESS_OFFSET 0xc4
#define OMAP343X_TABLE_VALUE_OFFSET 0xc0 #define OMAP343X_TABLE_VALUE_OFFSET 0xc0
@ -387,10 +400,11 @@ void omap_sram_idle(void)
} }
/* Block console output in case it is on one of the OMAP UARTs */ /* Block console output in case it is on one of the OMAP UARTs */
if (per_next_state < PWRDM_POWER_ON || if (!is_suspending())
core_next_state < PWRDM_POWER_ON) if (per_next_state < PWRDM_POWER_ON ||
if (try_acquire_console_sem()) core_next_state < PWRDM_POWER_ON)
goto console_still_active; if (try_acquire_console_sem())
goto console_still_active;
/* PER */ /* PER */
if (per_next_state < PWRDM_POWER_ON) { if (per_next_state < PWRDM_POWER_ON) {
@ -470,7 +484,8 @@ void omap_sram_idle(void)
omap_uart_resume_idle(3); omap_uart_resume_idle(3);
} }
release_console_sem(); if (!is_suspending())
release_console_sem();
console_still_active: console_still_active:
/* Disable IO-PAD and IO-CHAIN wakeup */ /* Disable IO-PAD and IO-CHAIN wakeup */
@ -514,8 +529,6 @@ static void omap3_pm_idle(void)
} }
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state;
static int omap3_pm_prepare(void) static int omap3_pm_prepare(void)
{ {
disable_hlt(); disable_hlt();

View File

@ -243,13 +243,14 @@
#define OMAP24XX_EN_GPT1_MASK (1 << 0) #define OMAP24XX_EN_GPT1_MASK (1 << 0)
/* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */
#define OMAP24XX_ST_GPIOS_SHIFT (1 << 2) #define OMAP24XX_ST_GPIOS_SHIFT 2
#define OMAP24XX_ST_GPIOS_MASK 2 #define OMAP24XX_ST_GPIOS_MASK (1 << 2)
#define OMAP24XX_ST_GPT1_SHIFT (1 << 0) #define OMAP24XX_ST_GPT1_SHIFT 0
#define OMAP24XX_ST_GPT1_MASK 0 #define OMAP24XX_ST_GPT1_MASK (1 << 0)
/* CM_IDLEST_MDM and PM_WKST_MDM shared bits */ /* CM_IDLEST_MDM and PM_WKST_MDM shared bits */
#define OMAP2430_ST_MDM_SHIFT (1 << 0) #define OMAP2430_ST_MDM_SHIFT 0
#define OMAP2430_ST_MDM_MASK (1 << 0)
/* 3430 register bits shared between CM & PRM registers */ /* 3430 register bits shared between CM & PRM registers */

View File

@ -241,7 +241,8 @@ static inline void palmtx_keys_init(void) {}
/****************************************************************************** /******************************************************************************
* NAND Flash * NAND Flash
******************************************************************************/ ******************************************************************************/
#if defined(CONFIG_MTD_NAND_GPIO) || defined(CONFIG_MTD_NAND_GPIO_MODULE) #if defined(CONFIG_MTD_NAND_PLATFORM) || \
defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd, static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {

View File

@ -28,9 +28,16 @@ config S3C2412_DMA
config S3C2412_PM config S3C2412_PM
bool bool
select S3C2412_PM_SLEEP
help help
Internal config node to apply S3C2412 power management Internal config node to apply S3C2412 power management
config S3C2412_PM_SLEEP
bool
help
Internal config node to apply sleep for S3C2412 power management.
Can be selected by another SoCs with similar sleep procedure.
# Note, the S3C2412 IOtiming support is in plat-s3c24xx # Note, the S3C2412 IOtiming support is in plat-s3c24xx
config S3C2412_CPUFREQ config S3C2412_CPUFREQ

View File

@ -14,7 +14,8 @@ obj-$(CONFIG_CPU_S3C2412) += irq.o
obj-$(CONFIG_CPU_S3C2412) += clock.o obj-$(CONFIG_CPU_S3C2412) += clock.o
obj-$(CONFIG_CPU_S3C2412) += gpio.o obj-$(CONFIG_CPU_S3C2412) += gpio.o
obj-$(CONFIG_S3C2412_DMA) += dma.o obj-$(CONFIG_S3C2412_DMA) += dma.o
obj-$(CONFIG_S3C2412_PM) += pm.o sleep.o obj-$(CONFIG_S3C2412_PM) += pm.o
obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep.o
obj-$(CONFIG_S3C2412_CPUFREQ) += cpu-freq.o obj-$(CONFIG_S3C2412_CPUFREQ) += cpu-freq.o
# Machine support # Machine support

View File

@ -27,6 +27,7 @@ config S3C2416_DMA
config S3C2416_PM config S3C2416_PM
bool bool
select S3C2412_PM_SLEEP
help help
Internal config node to apply S3C2416 power management Internal config node to apply S3C2416 power management

View File

@ -378,6 +378,12 @@ static struct max8998_regulator_data aquila_regulators[] = {
static struct max8998_platform_data aquila_max8998_pdata = { static struct max8998_platform_data aquila_max8998_pdata = {
.num_regulators = ARRAY_SIZE(aquila_regulators), .num_regulators = ARRAY_SIZE(aquila_regulators),
.regulators = aquila_regulators, .regulators = aquila_regulators,
.buck1_set1 = S5PV210_GPH0(3),
.buck1_set2 = S5PV210_GPH0(4),
.buck2_set3 = S5PV210_GPH0(5),
.buck1_max_voltage1 = 1200000,
.buck1_max_voltage2 = 1200000,
.buck2_max_voltage = 1200000,
}; };
#endif #endif

View File

@ -518,6 +518,12 @@ static struct max8998_regulator_data goni_regulators[] = {
static struct max8998_platform_data goni_max8998_pdata = { static struct max8998_platform_data goni_max8998_pdata = {
.num_regulators = ARRAY_SIZE(goni_regulators), .num_regulators = ARRAY_SIZE(goni_regulators),
.regulators = goni_regulators, .regulators = goni_regulators,
.buck1_set1 = S5PV210_GPH0(3),
.buck1_set2 = S5PV210_GPH0(4),
.buck2_set3 = S5PV210_GPH0(5),
.buck1_max_voltage1 = 1200000,
.buck1_max_voltage2 = 1200000,
.buck2_max_voltage = 1200000,
}; };
#endif #endif

View File

@ -1,4 +1,5 @@
/* /*
* Copyright (C) 2010 Magnus Damm
* Copyright (C) 2008 Renesas Solutions Corp. * Copyright (C) 2008 Renesas Solutions Corp.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -14,24 +15,45 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#define INTCA_BASE 0xe6980000
#define INTFLGA_OFFS 0x00000018 /* accept pending interrupt */
#define INTEVTA_OFFS 0x00000020 /* vector number of accepted interrupt */
#define INTLVLA_OFFS 0x00000030 /* priority level of accepted interrupt */
#define INTLVLB_OFFS 0x00000034 /* previous priority level */
.macro disable_fiq .macro disable_fiq
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
ldr \base, =INTFLGA ldr \base, =INTCA_BASE
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
.endm .endm
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
ldr \irqnr, [\base] /* The single INTFLGA read access below results in the following:
*
* 1. INTLVLB is updated with old priority value from INTLVLA
* 2. Highest priority interrupt is accepted
* 3. INTLVLA is updated to contain priority of accepted interrupt
* 4. Accepted interrupt vector is stored in INTFLGA and INTEVTA
*/
ldr \irqnr, [\base, #INTFLGA_OFFS]
/* Restore INTLVLA with the value saved in INTLVLB.
* This is required to support interrupt priorities properly.
*/
ldrb \tmp, [\base, #INTLVLB_OFFS]
strb \tmp, [\base, #INTLVLA_OFFS]
/* Handle invalid vector number case */
cmp \irqnr, #0 cmp \irqnr, #0
beq 1000f beq 1000f
/* intevt to irq number */
/* Convert vector to irq number, same as the evt2irq() macro */
lsr \irqnr, \irqnr, #0x5 lsr \irqnr, \irqnr, #0x5
subs \irqnr, \irqnr, #16 subs \irqnr, \irqnr, #16

View File

@ -2,6 +2,6 @@
#define __ASM_MACH_VMALLOC_H #define __ASM_MACH_VMALLOC_H
/* Vmalloc at ... - 0xe5ffffff */ /* Vmalloc at ... - 0xe5ffffff */
#define VMALLOC_END 0xe6000000 #define VMALLOC_END 0xe6000000UL
#endif /* __ASM_MACH_VMALLOC_H */ #endif /* __ASM_MACH_VMALLOC_H */

View File

@ -203,6 +203,10 @@ ENTRY(v6_flush_kern_dcache_area)
* - end - virtual end address of region * - end - virtual end address of region
*/ */
v6_dma_inv_range: v6_dma_inv_range:
#ifdef CONFIG_DMA_CACHE_RWFO
ldrb r2, [r0] @ read for ownership
strb r2, [r0] @ write for ownership
#endif
tst r0, #D_CACHE_LINE_SIZE - 1 tst r0, #D_CACHE_LINE_SIZE - 1
bic r0, r0, #D_CACHE_LINE_SIZE - 1 bic r0, r0, #D_CACHE_LINE_SIZE - 1
#ifdef HARVARD_CACHE #ifdef HARVARD_CACHE
@ -211,6 +215,10 @@ v6_dma_inv_range:
mcrne p15, 0, r0, c7, c11, 1 @ clean unified line mcrne p15, 0, r0, c7, c11, 1 @ clean unified line
#endif #endif
tst r1, #D_CACHE_LINE_SIZE - 1 tst r1, #D_CACHE_LINE_SIZE - 1
#ifdef CONFIG_DMA_CACHE_RWFO
ldrneb r2, [r1, #-1] @ read for ownership
strneb r2, [r1, #-1] @ write for ownership
#endif
bic r1, r1, #D_CACHE_LINE_SIZE - 1 bic r1, r1, #D_CACHE_LINE_SIZE - 1
#ifdef HARVARD_CACHE #ifdef HARVARD_CACHE
mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line
@ -218,10 +226,6 @@ v6_dma_inv_range:
mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line
#endif #endif
1: 1:
#ifdef CONFIG_DMA_CACHE_RWFO
ldr r2, [r0] @ read for ownership
str r2, [r0] @ write for ownership
#endif
#ifdef HARVARD_CACHE #ifdef HARVARD_CACHE
mcr p15, 0, r0, c7, c6, 1 @ invalidate D line mcr p15, 0, r0, c7, c6, 1 @ invalidate D line
#else #else
@ -229,6 +233,10 @@ v6_dma_inv_range:
#endif #endif
add r0, r0, #D_CACHE_LINE_SIZE add r0, r0, #D_CACHE_LINE_SIZE
cmp r0, r1 cmp r0, r1
#ifdef CONFIG_DMA_CACHE_RWFO
ldrlo r2, [r0] @ read for ownership
strlo r2, [r0] @ write for ownership
#endif
blo 1b blo 1b
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
@ -263,12 +271,12 @@ v6_dma_clean_range:
* - end - virtual end address of region * - end - virtual end address of region
*/ */
ENTRY(v6_dma_flush_range) ENTRY(v6_dma_flush_range)
#ifdef CONFIG_DMA_CACHE_RWFO
ldrb r2, [r0] @ read for ownership
strb r2, [r0] @ write for ownership
#endif
bic r0, r0, #D_CACHE_LINE_SIZE - 1 bic r0, r0, #D_CACHE_LINE_SIZE - 1
1: 1:
#ifdef CONFIG_DMA_CACHE_RWFO
ldr r2, [r0] @ read for ownership
str r2, [r0] @ write for ownership
#endif
#ifdef HARVARD_CACHE #ifdef HARVARD_CACHE
mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line
#else #else
@ -276,6 +284,10 @@ ENTRY(v6_dma_flush_range)
#endif #endif
add r0, r0, #D_CACHE_LINE_SIZE add r0, r0, #D_CACHE_LINE_SIZE
cmp r0, r1 cmp r0, r1
#ifdef CONFIG_DMA_CACHE_RWFO
ldrlob r2, [r0] @ read for ownership
strlob r2, [r0] @ write for ownership
#endif
blo 1b blo 1b
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer mcr p15, 0, r0, c7, c10, 4 @ drain write buffer

View File

@ -173,15 +173,22 @@ ENTRY(v7_coherent_user_range)
UNWIND(.fnstart ) UNWIND(.fnstart )
dcache_line_size r2, r3 dcache_line_size r2, r3
sub r3, r2, #1 sub r3, r2, #1
bic r0, r0, r3 bic r12, r0, r3
1: 1:
USER( mcr p15, 0, r0, c7, c11, 1 ) @ clean D line to the point of unification USER( mcr p15, 0, r12, c7, c11, 1 ) @ clean D line to the point of unification
dsb add r12, r12, r2
USER( mcr p15, 0, r0, c7, c5, 1 ) @ invalidate I line cmp r12, r1
add r0, r0, r2
2:
cmp r0, r1
blo 1b blo 1b
dsb
icache_line_size r2, r3
sub r3, r2, #1
bic r12, r0, r3
2:
USER( mcr p15, 0, r12, c7, c5, 1 ) @ invalidate I line
add r12, r12, r2
cmp r12, r1
blo 2b
3:
mov r0, #0 mov r0, #0
ALT_SMP(mcr p15, 0, r0, c7, c1, 6) @ invalidate BTB Inner Shareable ALT_SMP(mcr p15, 0, r0, c7, c1, 6) @ invalidate BTB Inner Shareable
ALT_UP(mcr p15, 0, r0, c7, c5, 6) @ invalidate BTB ALT_UP(mcr p15, 0, r0, c7, c5, 6) @ invalidate BTB
@ -194,10 +201,10 @@ ENTRY(v7_coherent_user_range)
* isn't mapped, just try the next page. * isn't mapped, just try the next page.
*/ */
9001: 9001:
mov r0, r0, lsr #12 mov r12, r12, lsr #12
mov r0, r0, lsl #12 mov r12, r12, lsl #12
add r0, r0, #4096 add r12, r12, #4096
b 2b b 3b
UNWIND(.fnend ) UNWIND(.fnend )
ENDPROC(v7_coherent_kern_range) ENDPROC(v7_coherent_kern_range)
ENDPROC(v7_coherent_user_range) ENDPROC(v7_coherent_user_range)

View File

@ -61,17 +61,27 @@
.endm .endm
/* /*
* cache_line_size - get the cache line size from the CSIDR register * dcache_line_size - get the minimum D-cache line size from the CTR register
* (available on ARMv7+). It assumes that the CSSR register was configured * on ARMv7.
* to access the L1 data cache CSIDR.
*/ */
.macro dcache_line_size, reg, tmp .macro dcache_line_size, reg, tmp
mrc p15, 1, \tmp, c0, c0, 0 @ read CSIDR mrc p15, 0, \tmp, c0, c0, 1 @ read ctr
and \tmp, \tmp, #7 @ cache line size encoding lsr \tmp, \tmp, #16
mov \reg, #16 @ size offset and \tmp, \tmp, #0xf @ cache line size encoding
mov \reg, #4 @ bytes per word
mov \reg, \reg, lsl \tmp @ actual cache line size mov \reg, \reg, lsl \tmp @ actual cache line size
.endm .endm
/*
* icache_line_size - get the minimum I-cache line size from the CTR register
* on ARMv7.
*/
.macro icache_line_size, reg, tmp
mrc p15, 0, \tmp, c0, c0, 1 @ read ctr
and \tmp, \tmp, #0xf @ cache line size encoding
mov \reg, #4 @ bytes per word
mov \reg, \reg, lsl \tmp @ actual cache line size
.endm
/* /*
* Sanity check the PTE configuration for the code below - which makes * Sanity check the PTE configuration for the code below - which makes

View File

@ -16,6 +16,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/err.h>
#include <plat/common.h> #include <plat/common.h>
#include <plat/board.h> #include <plat/board.h>
@ -164,7 +165,7 @@ static int __init omap_init_clocksource_32k(void)
return -ENODEV; return -ENODEV;
sync_32k_ick = clk_get(NULL, "omap_32ksync_ick"); sync_32k_ick = clk_get(NULL, "omap_32ksync_ick");
if (sync_32k_ick) if (!IS_ERR(sync_32k_ick))
clk_enable(sync_32k_ick); clk_enable(sync_32k_ick);
clocksource_32k.mult = clocksource_hz2mult(32768, clocksource_32k.mult = clocksource_hz2mult(32768,

View File

@ -166,7 +166,7 @@ static void __init omap_detect_sram(void)
cpu_is_omap1710()) cpu_is_omap1710())
omap_sram_size = 0x4000; /* 16K */ omap_sram_size = 0x4000; /* 16K */
else if (cpu_is_omap1611()) else if (cpu_is_omap1611())
omap_sram_size = 0x3e800; /* 250K */ omap_sram_size = SZ_256K;
else { else {
printk(KERN_ERR "Could not detect SRAM size\n"); printk(KERN_ERR "Could not detect SRAM size\n");
omap_sram_size = 0x4000; omap_sram_size = 0x4000;

View File

@ -8,7 +8,7 @@ config PLAT_S3C24XX
default y default y
select NO_IOPORT select NO_IOPORT
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select S3C_DEVICE_NAND select S3C_DEV_NAND
select S3C_GPIO_CFG_S3C24XX select S3C_GPIO_CFG_S3C24XX
help help
Base platform code for any Samsung S3C24XX device Base platform code for any Samsung S3C24XX device

View File

@ -12,7 +12,7 @@
# #
# http://www.arm.linux.org.uk/developer/machines/?action=new # http://www.arm.linux.org.uk/developer/machines/?action=new
# #
# Last update: Thu Sep 9 22:43:01 2010 # Last update: Sun Dec 12 23:24:27 2010
# #
# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
# #
@ -2321,7 +2321,7 @@ mx31txtr MACH_MX31TXTR MX31TXTR 2332
u380 MACH_U380 U380 2333 u380 MACH_U380 U380 2333
oamp3_hualu MACH_HUALU_BOARD HUALU_BOARD 2334 oamp3_hualu MACH_HUALU_BOARD HUALU_BOARD 2334
npcmx50 MACH_NPCMX50 NPCMX50 2335 npcmx50 MACH_NPCMX50 NPCMX50 2335
mx51_lange51 MACH_MX51_LANGE51 MX51_LANGE51 2336 mx51_efikamx MACH_MX51_EFIKAMX MX51_EFIKAMX 2336
mx51_lange52 MACH_MX51_LANGE52 MX51_LANGE52 2337 mx51_lange52 MACH_MX51_LANGE52 MX51_LANGE52 2337
riom MACH_RIOM RIOM 2338 riom MACH_RIOM RIOM 2338
comcas MACH_COMCAS COMCAS 2339 comcas MACH_COMCAS COMCAS 2339
@ -2355,7 +2355,7 @@ at91sam9263cs MACH_AT91SAM9263CS AT91SAM9263CS 2366
csb732 MACH_CSB732 CSB732 2367 csb732 MACH_CSB732 CSB732 2367
u8500 MACH_U8500 U8500 2368 u8500 MACH_U8500 U8500 2368
huqiu MACH_HUQIU HUQIU 2369 huqiu MACH_HUQIU HUQIU 2369
mx51_kunlun MACH_MX51_KUNLUN MX51_KUNLUN 2370 mx51_efikasb MACH_MX51_EFIKASB MX51_EFIKASB 2370
pmt1g MACH_PMT1G PMT1G 2371 pmt1g MACH_PMT1G PMT1G 2371
htcelf MACH_HTCELF HTCELF 2372 htcelf MACH_HTCELF HTCELF 2372
armadillo420 MACH_ARMADILLO420 ARMADILLO420 2373 armadillo420 MACH_ARMADILLO420 ARMADILLO420 2373
@ -2971,7 +2971,7 @@ premierwave_en MACH_PREMIERWAVE_EN PREMIERWAVE_EN 2985
wasabi MACH_WASABI WASABI 2986 wasabi MACH_WASABI WASABI 2986
vivow MACH_VIVOW VIVOW 2987 vivow MACH_VIVOW VIVOW 2987
mx50_rdp MACH_MX50_RDP MX50_RDP 2988 mx50_rdp MACH_MX50_RDP MX50_RDP 2988
universal MACH_UNIVERSAL UNIVERSAL 2989 universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989
real6410 MACH_REAL6410 REAL6410 2990 real6410 MACH_REAL6410 REAL6410 2990
spx_sakura MACH_SPX_SAKURA SPX_SAKURA 2991 spx_sakura MACH_SPX_SAKURA SPX_SAKURA 2991
ij3k_2440 MACH_IJ3K_2440 IJ3K_2440 2992 ij3k_2440 MACH_IJ3K_2440 IJ3K_2440 2992
@ -3044,3 +3044,178 @@ harvest_desoto MACH_HARVEST_DESOTO HARVEST_DESOTO 3059
msm8x60_qrdc MACH_MSM8X60_QRDC MSM8X60_QRDC 3060 msm8x60_qrdc MACH_MSM8X60_QRDC MSM8X60_QRDC 3060
spear900 MACH_SPEAR900 SPEAR900 3061 spear900 MACH_SPEAR900 SPEAR900 3061
pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062 pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062
rdstor MACH_RDSTOR RDSTOR 3063
usdloader MACH_USDLOADER USDLOADER 3064
tsoploader MACH_TSOPLOADER TSOPLOADER 3065
kronos MACH_KRONOS KRONOS 3066
ffcore MACH_FFCORE FFCORE 3067
mone MACH_MONE MONE 3068
unit2s MACH_UNIT2S UNIT2S 3069
acer_a5 MACH_ACER_A5 ACER_A5 3070
etherpro_isp MACH_ETHERPRO_ISP ETHERPRO_ISP 3071
stretchs7000 MACH_STRETCHS7000 STRETCHS7000 3072
p87_smartsim MACH_P87_SMARTSIM P87_SMARTSIM 3073
tulip MACH_TULIP TULIP 3074
sunflower MACH_SUNFLOWER SUNFLOWER 3075
rib MACH_RIB RIB 3076
clod MACH_CLOD CLOD 3077
rump MACH_RUMP RUMP 3078
tenderloin MACH_TENDERLOIN TENDERLOIN 3079
shortloin MACH_SHORTLOIN SHORTLOIN 3080
crespo MACH_CRESPO CRESPO 3081
antares MACH_ANTARES ANTARES 3082
wb40n MACH_WB40N WB40N 3083
herring MACH_HERRING HERRING 3084
naxy400 MACH_NAXY400 NAXY400 3085
naxy1200 MACH_NAXY1200 NAXY1200 3086
vpr200 MACH_VPR200 VPR200 3087
bug20 MACH_BUG20 BUG20 3088
goflexnet MACH_GOFLEXNET GOFLEXNET 3089
torbreck MACH_TORBRECK TORBRECK 3090
saarb_mg1 MACH_SAARB_MG1 SAARB_MG1 3091
callisto MACH_CALLISTO CALLISTO 3092
multhsu MACH_MULTHSU MULTHSU 3093
saluda MACH_SALUDA SALUDA 3094
pemp_omap3_apollo MACH_PEMP_OMAP3_APOLLO PEMP_OMAP3_APOLLO 3095
vc0718 MACH_VC0718 VC0718 3096
mvblx MACH_MVBLX MVBLX 3097
inhand_apeiron MACH_INHAND_APEIRON INHAND_APEIRON 3098
inhand_fury MACH_INHAND_FURY INHAND_FURY 3099
inhand_siren MACH_INHAND_SIREN INHAND_SIREN 3100
hdnvp MACH_HDNVP HDNVP 3101
softwinner MACH_SOFTWINNER SOFTWINNER 3102
prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
nas6210 MACH_NAS6210 NAS6210 3104
unisdev MACH_UNISDEV UNISDEV 3105
sbca11 MACH_SBCA11 SBCA11 3106
saga MACH_SAGA SAGA 3107
ns_k330 MACH_NS_K330 NS_K330 3108
tanna MACH_TANNA TANNA 3109
imate8502 MACH_IMATE8502 IMATE8502 3110
aspen MACH_ASPEN ASPEN 3111
daintree_cwac MACH_DAINTREE_CWAC DAINTREE_CWAC 3112
zmx25 MACH_ZMX25 ZMX25 3113
maple1 MACH_MAPLE1 MAPLE1 3114
qsd8x72_surf MACH_QSD8X72_SURF QSD8X72_SURF 3115
qsd8x72_ffa MACH_QSD8X72_FFA QSD8X72_FFA 3116
abilene MACH_ABILENE ABILENE 3117
eigen_ttr MACH_EIGEN_TTR EIGEN_TTR 3118
iomega_ix2_200 MACH_IOMEGA_IX2_200 IOMEGA_IX2_200 3119
coretec_vcx7400 MACH_CORETEC_VCX7400 CORETEC_VCX7400 3120
santiago MACH_SANTIAGO SANTIAGO 3121
mx257sol MACH_MX257SOL MX257SOL 3122
strasbourg MACH_STRASBOURG STRASBOURG 3123
msm8x60_fluid MACH_MSM8X60_FLUID MSM8X60_FLUID 3124
smartqv5 MACH_SMARTQV5 SMARTQV5 3125
smartqv3 MACH_SMARTQV3 SMARTQV3 3126
smartqv7 MACH_SMARTQV7 SMARTQV7 3127
paz00 MACH_PAZ00 PAZ00 3128
acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129
htcwillow MACH_HTCWILLOW HTCWILLOW 3130
fwbd_0404 MACH_FWBD_0404 FWBD_0404 3131
hdgu MACH_HDGU HDGU 3132
pyramid MACH_PYRAMID PYRAMID 3133
epiphan MACH_EPIPHAN EPIPHAN 3134
omap_bender MACH_OMAP_BENDER OMAP_BENDER 3135
gurnard MACH_GURNARD GURNARD 3136
gtl_it5100 MACH_GTL_IT5100 GTL_IT5100 3137
bcm2708 MACH_BCM2708 BCM2708 3138
mx51_ggc MACH_MX51_GGC MX51_GGC 3139
sharespace MACH_SHARESPACE SHARESPACE 3140
haba_knx_explorer MACH_HABA_KNX_EXPLORER HABA_KNX_EXPLORER 3141
simtec_kirkmod MACH_SIMTEC_KIRKMOD SIMTEC_KIRKMOD 3142
crux MACH_CRUX CRUX 3143
mx51_bravo MACH_MX51_BRAVO MX51_BRAVO 3144
charon MACH_CHARON CHARON 3145
picocom3 MACH_PICOCOM3 PICOCOM3 3146
picocom4 MACH_PICOCOM4 PICOCOM4 3147
serrano MACH_SERRANO SERRANO 3148
doubleshot MACH_DOUBLESHOT DOUBLESHOT 3149
evsy MACH_EVSY EVSY 3150
huashan MACH_HUASHAN HUASHAN 3151
lausanne MACH_LAUSANNE LAUSANNE 3152
emerald MACH_EMERALD EMERALD 3153
tqma35 MACH_TQMA35 TQMA35 3154
marvel MACH_MARVEL MARVEL 3155
manuae MACH_MANUAE MANUAE 3156
chacha MACH_CHACHA CHACHA 3157
lemon MACH_LEMON LEMON 3158
csc MACH_CSC CSC 3159
gira_knxip_router MACH_GIRA_KNXIP_ROUTER GIRA_KNXIP_ROUTER 3160
t20 MACH_T20 T20 3161
hdmini MACH_HDMINI HDMINI 3162
sciphone_g2 MACH_SCIPHONE_G2 SCIPHONE_G2 3163
express MACH_EXPRESS EXPRESS 3164
express_kt MACH_EXPRESS_KT EXPRESS_KT 3165
maximasp MACH_MAXIMASP MAXIMASP 3166
nitrogen_imx51 MACH_NITROGEN_IMX51 NITROGEN_IMX51 3167
nitrogen_imx53 MACH_NITROGEN_IMX53 NITROGEN_IMX53 3168
sunfire MACH_SUNFIRE SUNFIRE 3169
arowana MACH_AROWANA AROWANA 3170
tegra_daytona MACH_TEGRA_DAYTONA TEGRA_DAYTONA 3171
tegra_swordfish MACH_TEGRA_SWORDFISH TEGRA_SWORDFISH 3172
edison MACH_EDISON EDISON 3173
svp8500v1 MACH_SVP8500V1 SVP8500V1 3174
svp8500v2 MACH_SVP8500V2 SVP8500V2 3175
svp5500 MACH_SVP5500 SVP5500 3176
b5500 MACH_B5500 B5500 3177
s5500 MACH_S5500 S5500 3178
icon MACH_ICON ICON 3179
elephant MACH_ELEPHANT ELEPHANT 3180
msm8x60_fusion MACH_MSM8X60_FUSION MSM8X60_FUSION 3181
shooter MACH_SHOOTER SHOOTER 3182
spade_lte MACH_SPADE_LTE SPADE_LTE 3183
philhwani MACH_PHILHWANI PHILHWANI 3184
gsncomm MACH_GSNCOMM GSNCOMM 3185
strasbourg_a2 MACH_STRASBOURG_A2 STRASBOURG_A2 3186
mmm MACH_MMM MMM 3187
davinci_dm365_bv MACH_DAVINCI_DM365_BV DAVINCI_DM365_BV 3188
ag5evm MACH_AG5EVM AG5EVM 3189
sc575plc MACH_SC575PLC SC575PLC 3190
sc575hmi MACH_SC575IPC SC575IPC 3191
omap3_tdm3730 MACH_OMAP3_TDM3730 OMAP3_TDM3730 3192
g7 MACH_G7 G7 3193
top9000_eval MACH_TOP9000_EVAL TOP9000_EVAL 3194
top9000_su MACH_TOP9000_SU TOP9000_SU 3195
utm300 MACH_UTM300 UTM300 3196
tsunagi MACH_TSUNAGI TSUNAGI 3197
ts75xx MACH_TS75XX TS75XX 3198
msm8x60_fusn_ffa MACH_MSM8X60_FUSN_FFA MSM8X60_FUSN_FFA 3199
ts47xx MACH_TS47XX TS47XX 3200
da850_k5 MACH_DA850_K5 DA850_K5 3201
ax502 MACH_AX502 AX502 3202
igep0032 MACH_IGEP0032 IGEP0032 3203
antero MACH_ANTERO ANTERO 3204
synergy MACH_SYNERGY SYNERGY 3205
ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206
wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207
punica MACH_PUNICA PUNICA 3208
sbc_nt250 MACH_SBC_NT250 SBC_NT250 3209
mx27_wmultra MACH_MX27_WMULTRA MX27_WMULTRA 3210
mackerel MACH_MACKEREL MACKEREL 3211
fa9x27 MACH_FA9X27 FA9X27 3213
ns2816tb MACH_NS2816TB NS2816TB 3214
ns2816_ntpad MACH_NS2816_NTPAD NS2816_NTPAD 3215
ns2816_ntnb MACH_NS2816_NTNB NS2816_NTNB 3216
kaen MACH_KAEN KAEN 3217
nv1000 MACH_NV1000 NV1000 3218
nuc950ts MACH_NUC950TS NUC950TS 3219
nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220
ast2200 MACH_AST2200 AST2200 3221
lead MACH_LEAD LEAD 3222
unino1 MACH_UNINO1 UNINO1 3223
greeco MACH_GREECO GREECO 3224
verdi MACH_VERDI VERDI 3225
dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226
quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227
abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228
svcid MACH_SVCID SVCID 3229
msm8960_sim MACH_MSM8960_SIM MSM8960_SIM 3230
msm8960_rumi3 MACH_MSM8960_RUMI3 MSM8960_RUMI3 3231
icon_g MACH_ICON_G ICON_G 3232
mb3 MACH_MB3 MB3 3233
gsia18s MACH_GSIA18S GSIA18S 3234
pivicc MACH_PIVICC PIVICC 3235
pcm048 MACH_PCM048 PCM048 3236
dds MACH_DDS DDS 3237
chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238

View File

@ -19,6 +19,8 @@ config MIPS
select GENERIC_ATOMIC64 if !64BIT select GENERIC_ATOMIC64 if !64BIT
select HAVE_DMA_ATTRS select HAVE_DMA_ATTRS
select HAVE_DMA_API_DEBUG select HAVE_DMA_API_DEBUG
select HAVE_GENERIC_HARDIRQS
select GENERIC_IRQ_PROBE
menu "Machine selection" menu "Machine selection"
@ -1664,6 +1666,28 @@ config PAGE_SIZE_64KB
endchoice endchoice
config FORCE_MAX_ZONEORDER
int "Maximum zone order"
range 13 64 if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_32KB
default "13" if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_32KB
range 12 64 if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_16KB
default "12" if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_16KB
range 11 64
default "11"
help
The kernel memory allocator divides physically contiguous memory
blocks into "zones", where each zone is a power of two number of
pages. This option selects the largest power of two that the kernel
keeps in the memory allocator. If you need to allocate very large
blocks of physically contiguous memory, then you may need to
increase this value.
This config option is actually maximum order plus one. For example,
a value of 11 means that the largest free memory block is 2^10 pages.
The page size is not necessarily 4KB. Keep this in mind
when choosing a value for this option.
config BOARD_SCACHE config BOARD_SCACHE
bool bool
@ -1921,20 +1945,6 @@ config CPU_R4000_WORKAROUNDS
config CPU_R4400_WORKAROUNDS config CPU_R4400_WORKAROUNDS
bool bool
#
# Use the generic interrupt handling code in kernel/irq/:
#
config GENERIC_HARDIRQS
bool
default y
config GENERIC_IRQ_PROBE
bool
default y
config IRQ_PER_CPU
bool
# #
# - Highmem only makes sense for the 32-bit kernel. # - Highmem only makes sense for the 32-bit kernel.
# - The current highmem code will only work properly on physically indexed # - The current highmem code will only work properly on physically indexed

View File

@ -27,6 +27,7 @@
static void alchemy_8250_pm(struct uart_port *port, unsigned int state, static void alchemy_8250_pm(struct uart_port *port, unsigned int state,
unsigned int old_state) unsigned int old_state)
{ {
#ifdef CONFIG_SERIAL_8250
switch (state) { switch (state) {
case 0: case 0:
if ((__raw_readl(port->membase + UART_MOD_CNTRL) & 3) != 3) { if ((__raw_readl(port->membase + UART_MOD_CNTRL) & 3) != 3) {
@ -49,6 +50,7 @@ static void alchemy_8250_pm(struct uart_port *port, unsigned int state,
serial8250_do_pm(port, state, old_state); serial8250_do_pm(port, state, old_state);
break; break;
} }
#endif
} }
#define PORT(_base, _irq) \ #define PORT(_base, _irq) \

View File

@ -54,10 +54,9 @@ void __init prom_init(void)
prom_init_cmdline(); prom_init_cmdline();
memsize_str = prom_getenv("memsize"); memsize_str = prom_getenv("memsize");
if (!memsize_str) if (!memsize_str || strict_strtoul(memsize_str, 0, &memsize))
memsize = ALCHEMY_BOARD_DEFAULT_MEMSIZE; memsize = ALCHEMY_BOARD_DEFAULT_MEMSIZE;
else
strict_strtoul(memsize_str, 0, &memsize);
add_memory_region(0, memsize, BOOT_MEM_RAM); add_memory_region(0, memsize, BOOT_MEM_RAM);
} }

View File

@ -239,12 +239,12 @@ static void tnetd7300_set_clock(u32 shift, struct tnetd7300_clock *clock,
calculate(base_clock, frequency, &prediv, &postdiv, &mul); calculate(base_clock, frequency, &prediv, &postdiv, &mul);
writel(((prediv - 1) << PREDIV_SHIFT) | (postdiv - 1), &clock->ctrl); writel(((prediv - 1) << PREDIV_SHIFT) | (postdiv - 1), &clock->ctrl);
msleep(1); mdelay(1);
writel(4, &clock->pll); writel(4, &clock->pll);
while (readl(&clock->pll) & PLL_STATUS) while (readl(&clock->pll) & PLL_STATUS)
; ;
writel(((mul - 1) << MUL_SHIFT) | (0xff << 3) | 0x0e, &clock->pll); writel(((mul - 1) << MUL_SHIFT) | (0xff << 3) | 0x0e, &clock->pll);
msleep(75); mdelay(75);
} }
static void __init tnetd7300_init_clocks(void) static void __init tnetd7300_init_clocks(void)
@ -456,7 +456,7 @@ void clk_put(struct clk *clk)
} }
EXPORT_SYMBOL(clk_put); EXPORT_SYMBOL(clk_put);
int __init ar7_init_clocks(void) void __init ar7_init_clocks(void)
{ {
switch (ar7_chip_id()) { switch (ar7_chip_id()) {
case AR7_CHIP_7100: case AR7_CHIP_7100:
@ -472,7 +472,4 @@ int __init ar7_init_clocks(void)
} }
/* adjust vbus clock rate */ /* adjust vbus clock rate */
vbus_clk.rate = bus_clk.rate / 2; vbus_clk.rate = bus_clk.rate / 2;
return 0;
} }
arch_initcall(ar7_init_clocks);

View File

@ -30,6 +30,9 @@ void __init plat_time_init(void)
{ {
struct clk *cpu_clk; struct clk *cpu_clk;
/* Initialize ar7 clocks so the CPU clock frequency is correct */
ar7_init_clocks();
cpu_clk = clk_get(NULL, "cpu"); cpu_clk = clk_get(NULL, "cpu");
if (IS_ERR(cpu_clk)) { if (IS_ERR(cpu_clk)) {
printk(KERN_ERR "unable to get cpu clock\n"); printk(KERN_ERR "unable to get cpu clock\n");

View File

@ -32,7 +32,6 @@
#include <asm/reboot.h> #include <asm/reboot.h>
#include <asm/time.h> #include <asm/time.h>
#include <bcm47xx.h> #include <bcm47xx.h>
#include <asm/fw/cfe/cfe_api.h>
#include <asm/mach-bcm47xx/nvram.h> #include <asm/mach-bcm47xx/nvram.h>
struct ssb_bus ssb_bcm47xx; struct ssb_bus ssb_bcm47xx;
@ -57,68 +56,112 @@ static void bcm47xx_machine_halt(void)
cpu_relax(); cpu_relax();
} }
static void str2eaddr(char *str, char *dest) #define READ_FROM_NVRAM(_outvar, name, buf) \
if (nvram_getenv(name, buf, sizeof(buf)) >= 0)\
sprom->_outvar = simple_strtoul(buf, NULL, 0);
static void bcm47xx_fill_sprom(struct ssb_sprom *sprom)
{ {
int i = 0; char buf[100];
u32 boardflags;
if (str == NULL) { memset(sprom, 0, sizeof(struct ssb_sprom));
memset(dest, 0, 6);
return; sprom->revision = 1; /* Fallback: Old hardware does not define this. */
READ_FROM_NVRAM(revision, "sromrev", buf);
if (nvram_getenv("il0macaddr", buf, sizeof(buf)) >= 0)
nvram_parse_macaddr(buf, sprom->il0mac);
if (nvram_getenv("et0macaddr", buf, sizeof(buf)) >= 0)
nvram_parse_macaddr(buf, sprom->et0mac);
if (nvram_getenv("et1macaddr", buf, sizeof(buf)) >= 0)
nvram_parse_macaddr(buf, sprom->et1mac);
READ_FROM_NVRAM(et0phyaddr, "et0phyaddr", buf);
READ_FROM_NVRAM(et1phyaddr, "et1phyaddr", buf);
READ_FROM_NVRAM(et0mdcport, "et0mdcport", buf);
READ_FROM_NVRAM(et1mdcport, "et1mdcport", buf);
READ_FROM_NVRAM(board_rev, "boardrev", buf);
READ_FROM_NVRAM(country_code, "ccode", buf);
READ_FROM_NVRAM(ant_available_a, "aa5g", buf);
READ_FROM_NVRAM(ant_available_bg, "aa2g", buf);
READ_FROM_NVRAM(pa0b0, "pa0b0", buf);
READ_FROM_NVRAM(pa0b1, "pa0b1", buf);
READ_FROM_NVRAM(pa0b2, "pa0b2", buf);
READ_FROM_NVRAM(pa1b0, "pa1b0", buf);
READ_FROM_NVRAM(pa1b1, "pa1b1", buf);
READ_FROM_NVRAM(pa1b2, "pa1b2", buf);
READ_FROM_NVRAM(pa1lob0, "pa1lob0", buf);
READ_FROM_NVRAM(pa1lob2, "pa1lob1", buf);
READ_FROM_NVRAM(pa1lob1, "pa1lob2", buf);
READ_FROM_NVRAM(pa1hib0, "pa1hib0", buf);
READ_FROM_NVRAM(pa1hib2, "pa1hib1", buf);
READ_FROM_NVRAM(pa1hib1, "pa1hib2", buf);
READ_FROM_NVRAM(gpio0, "wl0gpio0", buf);
READ_FROM_NVRAM(gpio1, "wl0gpio1", buf);
READ_FROM_NVRAM(gpio2, "wl0gpio2", buf);
READ_FROM_NVRAM(gpio3, "wl0gpio3", buf);
READ_FROM_NVRAM(maxpwr_bg, "pa0maxpwr", buf);
READ_FROM_NVRAM(maxpwr_al, "pa1lomaxpwr", buf);
READ_FROM_NVRAM(maxpwr_a, "pa1maxpwr", buf);
READ_FROM_NVRAM(maxpwr_ah, "pa1himaxpwr", buf);
READ_FROM_NVRAM(itssi_a, "pa1itssit", buf);
READ_FROM_NVRAM(itssi_bg, "pa0itssit", buf);
READ_FROM_NVRAM(tri2g, "tri2g", buf);
READ_FROM_NVRAM(tri5gl, "tri5gl", buf);
READ_FROM_NVRAM(tri5g, "tri5g", buf);
READ_FROM_NVRAM(tri5gh, "tri5gh", buf);
READ_FROM_NVRAM(rxpo2g, "rxpo2g", buf);
READ_FROM_NVRAM(rxpo5g, "rxpo5g", buf);
READ_FROM_NVRAM(rssisav2g, "rssisav2g", buf);
READ_FROM_NVRAM(rssismc2g, "rssismc2g", buf);
READ_FROM_NVRAM(rssismf2g, "rssismf2g", buf);
READ_FROM_NVRAM(bxa2g, "bxa2g", buf);
READ_FROM_NVRAM(rssisav5g, "rssisav5g", buf);
READ_FROM_NVRAM(rssismc5g, "rssismc5g", buf);
READ_FROM_NVRAM(rssismf5g, "rssismf5g", buf);
READ_FROM_NVRAM(bxa5g, "bxa5g", buf);
READ_FROM_NVRAM(cck2gpo, "cck2gpo", buf);
READ_FROM_NVRAM(ofdm2gpo, "ofdm2gpo", buf);
READ_FROM_NVRAM(ofdm5glpo, "ofdm5glpo", buf);
READ_FROM_NVRAM(ofdm5gpo, "ofdm5gpo", buf);
READ_FROM_NVRAM(ofdm5ghpo, "ofdm5ghpo", buf);
if (nvram_getenv("boardflags", buf, sizeof(buf)) >= 0) {
boardflags = simple_strtoul(buf, NULL, 0);
if (boardflags) {
sprom->boardflags_lo = (boardflags & 0x0000FFFFU);
sprom->boardflags_hi = (boardflags & 0xFFFF0000U) >> 16;
}
} }
if (nvram_getenv("boardflags2", buf, sizeof(buf)) >= 0) {
for (;;) { boardflags = simple_strtoul(buf, NULL, 0);
dest[i++] = (char) simple_strtoul(str, NULL, 16); if (boardflags) {
str += 2; sprom->boardflags2_lo = (boardflags & 0x0000FFFFU);
if (!*str++ || i == 6) sprom->boardflags2_hi = (boardflags & 0xFFFF0000U) >> 16;
break; }
} }
} }
static int bcm47xx_get_invariants(struct ssb_bus *bus, static int bcm47xx_get_invariants(struct ssb_bus *bus,
struct ssb_init_invariants *iv) struct ssb_init_invariants *iv)
{ {
char buf[100]; char buf[20];
/* Fill boardinfo structure */ /* Fill boardinfo structure */
memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo)); memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
if (cfe_getenv("boardvendor", buf, sizeof(buf)) >= 0 || if (nvram_getenv("boardvendor", buf, sizeof(buf)) >= 0)
nvram_getenv("boardvendor", buf, sizeof(buf)) >= 0) iv->boardinfo.vendor = (u16)simple_strtoul(buf, NULL, 0);
else
iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0); iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
if (cfe_getenv("boardtype", buf, sizeof(buf)) >= 0 || if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
if (cfe_getenv("boardrev", buf, sizeof(buf)) >= 0 ||
nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0); iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
/* Fill sprom structure */ bcm47xx_fill_sprom(&iv->sprom);
memset(&(iv->sprom), 0, sizeof(struct ssb_sprom));
iv->sprom.revision = 3;
if (cfe_getenv("et0macaddr", buf, sizeof(buf)) >= 0 || if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
nvram_getenv("et0macaddr", buf, sizeof(buf)) >= 0) iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);
str2eaddr(buf, iv->sprom.et0mac);
if (cfe_getenv("et1macaddr", buf, sizeof(buf)) >= 0 ||
nvram_getenv("et1macaddr", buf, sizeof(buf)) >= 0)
str2eaddr(buf, iv->sprom.et1mac);
if (cfe_getenv("et0phyaddr", buf, sizeof(buf)) >= 0 ||
nvram_getenv("et0phyaddr", buf, sizeof(buf)) >= 0)
iv->sprom.et0phyaddr = simple_strtoul(buf, NULL, 0);
if (cfe_getenv("et1phyaddr", buf, sizeof(buf)) >= 0 ||
nvram_getenv("et1phyaddr", buf, sizeof(buf)) >= 0)
iv->sprom.et1phyaddr = simple_strtoul(buf, NULL, 0);
if (cfe_getenv("et0mdcport", buf, sizeof(buf)) >= 0 ||
nvram_getenv("et0mdcport", buf, sizeof(buf)) >= 0)
iv->sprom.et0mdcport = simple_strtoul(buf, NULL, 10);
if (cfe_getenv("et1mdcport", buf, sizeof(buf)) >= 0 ||
nvram_getenv("et1mdcport", buf, sizeof(buf)) >= 0)
iv->sprom.et1mdcport = simple_strtoul(buf, NULL, 10);
return 0; return 0;
} }
@ -126,12 +169,28 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
void __init plat_mem_setup(void) void __init plat_mem_setup(void)
{ {
int err; int err;
char buf[100];
struct ssb_mipscore *mcore;
err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
bcm47xx_get_invariants); bcm47xx_get_invariants);
if (err) if (err)
panic("Failed to initialize SSB bus (err %d)\n", err); panic("Failed to initialize SSB bus (err %d)\n", err);
mcore = &ssb_bcm47xx.mipscore;
if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
if (strstr(buf, "console=ttyS1")) {
struct ssb_serial_port port;
printk(KERN_DEBUG "Swapping serial ports!\n");
/* swap serial ports */
memcpy(&port, &mcore->serial_ports[0], sizeof(port));
memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
sizeof(port));
memcpy(&mcore->serial_ports[1], &port, sizeof(port));
}
}
_machine_restart = bcm47xx_machine_restart; _machine_restart = bcm47xx_machine_restart;
_machine_halt = bcm47xx_machine_halt; _machine_halt = bcm47xx_machine_halt;
pm_power_off = bcm47xx_machine_halt; pm_power_off = bcm47xx_machine_halt;

View File

@ -111,8 +111,8 @@
* These are the PRID's for when 23:16 == PRID_COMP_BROADCOM * These are the PRID's for when 23:16 == PRID_COMP_BROADCOM
*/ */
#define PRID_IMP_BMIPS4KC 0x4000 #define PRID_IMP_BMIPS32_REV4 0x4000
#define PRID_IMP_BMIPS32 0x8000 #define PRID_IMP_BMIPS32_REV8 0x8000
#define PRID_IMP_BMIPS3300 0x9000 #define PRID_IMP_BMIPS3300 0x9000
#define PRID_IMP_BMIPS3300_ALT 0x9100 #define PRID_IMP_BMIPS3300_ALT 0x9100
#define PRID_IMP_BMIPS3300_BUG 0x0000 #define PRID_IMP_BMIPS3300_BUG 0x0000

View File

@ -249,7 +249,8 @@ extern struct mips_abi mips_abi_n32;
#define SET_PERSONALITY(ex) \ #define SET_PERSONALITY(ex) \
do { \ do { \
set_personality(PER_LINUX); \ if (personality(current->personality) != PER_LINUX) \
set_personality(PER_LINUX); \
\ \
current->thread.abi = &mips_abi; \ current->thread.abi = &mips_abi; \
} while (0) } while (0)
@ -296,6 +297,8 @@ do { \
#define SET_PERSONALITY(ex) \ #define SET_PERSONALITY(ex) \
do { \ do { \
unsigned int p; \
\
clear_thread_flag(TIF_32BIT_REGS); \ clear_thread_flag(TIF_32BIT_REGS); \
clear_thread_flag(TIF_32BIT_ADDR); \ clear_thread_flag(TIF_32BIT_ADDR); \
\ \
@ -304,7 +307,8 @@ do { \
else \ else \
current->thread.abi = &mips_abi; \ current->thread.abi = &mips_abi; \
\ \
if (current->personality != PER_LINUX32) \ p = personality(current->personality); \
if (p != PER_LINUX32 && p != PER_LINUX) \
set_personality(PER_LINUX); \ set_personality(PER_LINUX); \
} while (0) } while (0)

View File

@ -329,10 +329,14 @@ static inline void pfx##write##bwlq(type val, \
"dsrl32 %L0, %L0, 0" "\n\t" \ "dsrl32 %L0, %L0, 0" "\n\t" \
"dsll32 %M0, %M0, 0" "\n\t" \ "dsll32 %M0, %M0, 0" "\n\t" \
"or %L0, %L0, %M0" "\n\t" \ "or %L0, %L0, %M0" "\n\t" \
".set push" "\n\t" \
".set noreorder" "\n\t" \
".set nomacro" "\n\t" \
"sd %L0, %2" "\n\t" \ "sd %L0, %2" "\n\t" \
".set pop" "\n\t" \
".set mips0" "\n" \ ".set mips0" "\n" \
: "=r" (__tmp) \ : "=r" (__tmp) \
: "0" (__val), "m" (*__mem)); \ : "0" (__val), "R" (*__mem)); \
if (irq) \ if (irq) \
local_irq_restore(__flags); \ local_irq_restore(__flags); \
} else \ } else \
@ -355,12 +359,16 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
local_irq_save(__flags); \ local_irq_save(__flags); \
__asm__ __volatile__( \ __asm__ __volatile__( \
".set mips3" "\t\t# __readq" "\n\t" \ ".set mips3" "\t\t# __readq" "\n\t" \
".set push" "\n\t" \
".set noreorder" "\n\t" \
".set nomacro" "\n\t" \
"ld %L0, %1" "\n\t" \ "ld %L0, %1" "\n\t" \
".set pop" "\n\t" \
"dsra32 %M0, %L0, 0" "\n\t" \ "dsra32 %M0, %L0, 0" "\n\t" \
"sll %L0, %L0, 0" "\n\t" \ "sll %L0, %L0, 0" "\n\t" \
".set mips0" "\n" \ ".set mips0" "\n" \
: "=r" (__val) \ : "=r" (__val) \
: "m" (*__mem)); \ : "R" (*__mem)); \
if (irq) \ if (irq) \
local_irq_restore(__flags); \ local_irq_restore(__flags); \
} else { \ } else { \

View File

@ -201,7 +201,6 @@ static inline void ar7_device_off(u32 bit)
} }
int __init ar7_gpio_init(void); int __init ar7_gpio_init(void);
void __init ar7_init_clocks(void);
int __init ar7_gpio_init(void);
#endif /* __AR7_H__ */ #endif /* __AR7_H__ */

View File

@ -12,6 +12,7 @@
#define __NVRAM_H #define __NVRAM_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h>
struct nvram_header { struct nvram_header {
u32 magic; u32 magic;
@ -36,4 +37,10 @@ struct nvram_header {
extern int nvram_getenv(char *name, char *val, size_t val_len); extern int nvram_getenv(char *name, char *val, size_t val_len);
static inline void nvram_parse_macaddr(char *buf, u8 *macaddr)
{
sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0], &macaddr[1],
&macaddr[2], &macaddr[3], &macaddr[4], &macaddr[5]);
}
#endif #endif

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 2009 Qi Hardware inc., * Copyright (c) 2009 Qi Hardware inc.,
* Author: Xiangfu Liu <xiangfu@qi-hardware.com> * Author: Xiangfu Liu <xiangfu@qi-hardware.com>
* Copyright 2010, Lars-Petrer Clausen <lars@metafoo.de> * Copyright 2010, Lars-Peter Clausen <lars@metafoo.de>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 or later * it under the terms of the GNU General Public License version 2 or later
@ -235,7 +235,7 @@ static const unsigned int qi_lb60_keypad_rows[] = {
QI_LB60_GPIO_KEYIN(3), QI_LB60_GPIO_KEYIN(3),
QI_LB60_GPIO_KEYIN(4), QI_LB60_GPIO_KEYIN(4),
QI_LB60_GPIO_KEYIN(5), QI_LB60_GPIO_KEYIN(5),
QI_LB60_GPIO_KEYIN(7), QI_LB60_GPIO_KEYIN(6),
QI_LB60_GPIO_KEYIN8, QI_LB60_GPIO_KEYIN8,
}; };

View File

@ -208,7 +208,7 @@ struct platform_device jz4740_i2s_device = {
/* PCM */ /* PCM */
struct platform_device jz4740_pcm_device = { struct platform_device jz4740_pcm_device = {
.name = "jz4740-pcm", .name = "jz4740-pcm-audio",
.id = -1, .id = -1,
}; };

View File

@ -23,7 +23,7 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/mach-jz4740/base.h> #include <asm/mach-jz4740/base.h>
void jz4740_init_cmdline(int argc, char *argv[]) static __init void jz4740_init_cmdline(int argc, char *argv[])
{ {
unsigned int count = COMMAND_LINE_SIZE - 1; unsigned int count = COMMAND_LINE_SIZE - 1;
int i; int i;

View File

@ -32,7 +32,7 @@ static int mips_next_event(unsigned long delta,
cnt = read_c0_count(); cnt = read_c0_count();
cnt += delta; cnt += delta;
write_c0_compare(cnt); write_c0_compare(cnt);
res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0; res = ((int)(read_c0_count() - cnt) >= 0) ? -ETIME : 0;
return res; return res;
} }

View File

@ -905,7 +905,8 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
{ {
decode_configs(c); decode_configs(c);
switch (c->processor_id & 0xff00) { switch (c->processor_id & 0xff00) {
case PRID_IMP_BMIPS32: case PRID_IMP_BMIPS32_REV4:
case PRID_IMP_BMIPS32_REV8:
c->cputype = CPU_BMIPS32; c->cputype = CPU_BMIPS32;
__cpu_name[cpu] = "Broadcom BMIPS32"; __cpu_name[cpu] = "Broadcom BMIPS32";
break; break;
@ -933,10 +934,6 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
__cpu_name[cpu] = "Broadcom BMIPS5000"; __cpu_name[cpu] = "Broadcom BMIPS5000";
c->options |= MIPS_CPU_ULRI; c->options |= MIPS_CPU_ULRI;
break; break;
case PRID_IMP_BMIPS4KC:
c->cputype = CPU_4KC;
__cpu_name[cpu] = "MIPS 4Kc";
break;
} }
} }

View File

@ -251,14 +251,15 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
SYSCALL_DEFINE1(32_personality, unsigned long, personality) SYSCALL_DEFINE1(32_personality, unsigned long, personality)
{ {
unsigned int p = personality & 0xffffffff;
int ret; int ret;
personality &= 0xffffffff;
if (personality(current->personality) == PER_LINUX32 && if (personality(current->personality) == PER_LINUX32 &&
personality == PER_LINUX) personality(p) == PER_LINUX)
personality = PER_LINUX32; p = (p & ~PER_MASK) | PER_LINUX32;
ret = sys_personality(personality); ret = sys_personality(p);
if (ret == PER_LINUX32) if (ret != -1 && personality(ret) == PER_LINUX32)
ret = PER_LINUX; ret = (ret & ~PER_MASK) | PER_LINUX;
return ret; return ret;
} }

View File

@ -142,7 +142,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
childregs->regs[7] = 0; /* Clear error flag */ childregs->regs[7] = 0; /* Clear error flag */
childregs->regs[2] = 0; /* Child gets zero as return value */ childregs->regs[2] = 0; /* Child gets zero as return value */
regs->regs[2] = p->pid;
if (childregs->cp0_status & ST0_CU0) { if (childregs->cp0_status & ST0_CU0) {
childregs->regs[28] = (unsigned long) ti; childregs->regs[28] = (unsigned long) ti;

View File

@ -100,7 +100,7 @@ void __init device_tree_init(void)
return; return;
base = virt_to_phys((void *)initial_boot_params); base = virt_to_phys((void *)initial_boot_params);
size = initial_boot_params->totalsize; size = be32_to_cpu(initial_boot_params->totalsize);
/* Before we do anything, lets reserve the dt blob */ /* Before we do anything, lets reserve the dt blob */
reserve_mem_mach(base, size); reserve_mem_mach(base, size);

View File

@ -153,7 +153,7 @@ static void __cpuinit vsmp_init_secondary(void)
{ {
extern int gic_present; extern int gic_present;
/* This is Malta specific: IPI,performance and timer inetrrupts */ /* This is Malta specific: IPI,performance and timer interrupts */
if (gic_present) if (gic_present)
change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 | change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 |
STATUSF_IP6 | STATUSF_IP7); STATUSF_IP6 | STATUSF_IP7);

View File

@ -83,7 +83,8 @@ extern asmlinkage void handle_mcheck(void);
extern asmlinkage void handle_reserved(void); extern asmlinkage void handle_reserved(void);
extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
struct mips_fpu_struct *ctx, int has_fpu); struct mips_fpu_struct *ctx, int has_fpu,
void *__user *fault_addr);
void (*board_be_init)(void); void (*board_be_init)(void);
int (*board_be_handler)(struct pt_regs *regs, int is_fixup); int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
@ -661,12 +662,36 @@ asmlinkage void do_ov(struct pt_regs *regs)
force_sig_info(SIGFPE, &info, current); force_sig_info(SIGFPE, &info, current);
} }
static int process_fpemu_return(int sig, void __user *fault_addr)
{
if (sig == SIGSEGV || sig == SIGBUS) {
struct siginfo si = {0};
si.si_addr = fault_addr;
si.si_signo = sig;
if (sig == SIGSEGV) {
if (find_vma(current->mm, (unsigned long)fault_addr))
si.si_code = SEGV_ACCERR;
else
si.si_code = SEGV_MAPERR;
} else {
si.si_code = BUS_ADRERR;
}
force_sig_info(sig, &si, current);
return 1;
} else if (sig) {
force_sig(sig, current);
return 1;
} else {
return 0;
}
}
/* /*
* XXX Delayed fp exceptions when doing a lazy ctx switch XXX * XXX Delayed fp exceptions when doing a lazy ctx switch XXX
*/ */
asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
{ {
siginfo_t info; siginfo_t info = {0};
if (notify_die(DIE_FP, "FP exception", regs, 0, regs_to_trapnr(regs), SIGFPE) if (notify_die(DIE_FP, "FP exception", regs, 0, regs_to_trapnr(regs), SIGFPE)
== NOTIFY_STOP) == NOTIFY_STOP)
@ -675,6 +700,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
if (fcr31 & FPU_CSR_UNI_X) { if (fcr31 & FPU_CSR_UNI_X) {
int sig; int sig;
void __user *fault_addr = NULL;
/* /*
* Unimplemented operation exception. If we've got the full * Unimplemented operation exception. If we've got the full
@ -690,7 +716,8 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
lose_fpu(1); lose_fpu(1);
/* Run the emulator */ /* Run the emulator */
sig = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 1); sig = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 1,
&fault_addr);
/* /*
* We can't allow the emulated instruction to leave any of * We can't allow the emulated instruction to leave any of
@ -702,8 +729,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
own_fpu(1); /* Using the FPU again. */ own_fpu(1); /* Using the FPU again. */
/* If something went wrong, signal */ /* If something went wrong, signal */
if (sig) process_fpemu_return(sig, fault_addr);
force_sig(sig, current);
return; return;
} else if (fcr31 & FPU_CSR_INV_X) } else if (fcr31 & FPU_CSR_INV_X)
@ -996,11 +1022,11 @@ asmlinkage void do_cpu(struct pt_regs *regs)
if (!raw_cpu_has_fpu) { if (!raw_cpu_has_fpu) {
int sig; int sig;
void __user *fault_addr = NULL;
sig = fpu_emulator_cop1Handler(regs, sig = fpu_emulator_cop1Handler(regs,
&current->thread.fpu, 0); &current->thread.fpu,
if (sig) 0, &fault_addr);
force_sig(sig, current); if (!process_fpemu_return(sig, fault_addr))
else
mt_ase_fp_affinity(); mt_ase_fp_affinity();
} }

View File

@ -1092,6 +1092,10 @@ static int vpe_open(struct inode *inode, struct file *filp)
/* this of-course trashes what was there before... */ /* this of-course trashes what was there before... */
v->pbuffer = vmalloc(P_SIZE); v->pbuffer = vmalloc(P_SIZE);
if (!v->pbuffer) {
pr_warning("VPE loader: unable to allocate memory\n");
return -ENOMEM;
}
v->plen = P_SIZE; v->plen = P_SIZE;
v->load_addr = NULL; v->load_addr = NULL;
v->len = 0; v->len = 0;
@ -1149,10 +1153,9 @@ static int vpe_release(struct inode *inode, struct file *filp)
if (ret < 0) if (ret < 0)
v->shared_ptr = NULL; v->shared_ptr = NULL;
// cleanup any temp buffers vfree(v->pbuffer);
if (v->pbuffer)
vfree(v->pbuffer);
v->plen = 0; v->plen = 0;
return ret; return ret;
} }
@ -1169,11 +1172,6 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
if (v == NULL) if (v == NULL)
return -ENODEV; return -ENODEV;
if (v->pbuffer == NULL) {
printk(KERN_ERR "VPE loader: no buffer for program\n");
return -ENOMEM;
}
if ((count + v->len) > v->plen) { if ((count + v->len) > v->plen) {
printk(KERN_WARNING printk(KERN_WARNING
"VPE loader: elf size too big. Perhaps strip uneeded symbols\n"); "VPE loader: elf size too big. Perhaps strip uneeded symbols\n");

View File

@ -161,16 +161,16 @@ FEXPORT(__bzero)
.Lfwd_fixup: .Lfwd_fixup:
PTR_L t0, TI_TASK($28) PTR_L t0, TI_TASK($28)
LONG_L t0, THREAD_BUADDR(t0)
andi a2, 0x3f andi a2, 0x3f
LONG_L t0, THREAD_BUADDR(t0)
LONG_ADDU a2, t1 LONG_ADDU a2, t1
jr ra jr ra
LONG_SUBU a2, t0 LONG_SUBU a2, t0
.Lpartial_fixup: .Lpartial_fixup:
PTR_L t0, TI_TASK($28) PTR_L t0, TI_TASK($28)
LONG_L t0, THREAD_BUADDR(t0)
andi a2, LONGMASK andi a2, LONGMASK
LONG_L t0, THREAD_BUADDR(t0)
LONG_ADDU a2, t1 LONG_ADDU a2, t1
jr ra jr ra
LONG_SUBU a2, t0 LONG_SUBU a2, t0

View File

@ -29,9 +29,9 @@ unsigned long memsize, highmemsize;
#define parse_even_earlier(res, option, p) \ #define parse_even_earlier(res, option, p) \
do { \ do { \
int ret; \
if (strncmp(option, (char *)p, strlen(option)) == 0) \ if (strncmp(option, (char *)p, strlen(option)) == 0) \
strict_strtol((char *)p + strlen(option"="), \ ret = strict_strtol((char *)p + strlen(option"="), 10, &res); \
10, &res); \
} while (0) } while (0)
void __init prom_init_env(void) void __init prom_init_env(void)

View File

@ -64,7 +64,7 @@ static int fpu_emu(struct pt_regs *, struct mips_fpu_struct *,
#if __mips >= 4 && __mips != 32 #if __mips >= 4 && __mips != 32
static int fpux_emu(struct pt_regs *, static int fpux_emu(struct pt_regs *,
struct mips_fpu_struct *, mips_instruction); struct mips_fpu_struct *, mips_instruction, void *__user *);
#endif #endif
/* Further private data for which no space exists in mips_fpu_struct */ /* Further private data for which no space exists in mips_fpu_struct */
@ -208,16 +208,23 @@ static inline int cop1_64bit(struct pt_regs *xcp)
* Two instructions if the instruction is in a branch delay slot. * Two instructions if the instruction is in a branch delay slot.
*/ */
static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
void *__user *fault_addr)
{ {
mips_instruction ir; mips_instruction ir;
unsigned long emulpc, contpc; unsigned long emulpc, contpc;
unsigned int cond; unsigned int cond;
if (get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) { if (!access_ok(VERIFY_READ, xcp->cp0_epc, sizeof(mips_instruction))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)xcp->cp0_epc;
return SIGBUS; return SIGBUS;
} }
if (__get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)xcp->cp0_epc;
return SIGSEGV;
}
/* XXX NEC Vr54xx bug workaround */ /* XXX NEC Vr54xx bug workaround */
if ((xcp->cp0_cause & CAUSEF_BD) && !isBranchInstr(&ir)) if ((xcp->cp0_cause & CAUSEF_BD) && !isBranchInstr(&ir))
@ -245,10 +252,16 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
#endif #endif
return SIGILL; return SIGILL;
} }
if (get_user(ir, (mips_instruction __user *) emulpc)) { if (!access_ok(VERIFY_READ, emulpc, sizeof(mips_instruction))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)emulpc;
return SIGBUS; return SIGBUS;
} }
if (__get_user(ir, (mips_instruction __user *) emulpc)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)emulpc;
return SIGSEGV;
}
/* __compute_return_epc() will have updated cp0_epc */ /* __compute_return_epc() will have updated cp0_epc */
contpc = xcp->cp0_epc; contpc = xcp->cp0_epc;
/* In order not to confuse ptrace() et al, tweak context */ /* In order not to confuse ptrace() et al, tweak context */
@ -269,10 +282,17 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
u64 val; u64 val;
MIPS_FPU_EMU_INC_STATS(loads); MIPS_FPU_EMU_INC_STATS(loads);
if (get_user(val, va)) {
if (!access_ok(VERIFY_READ, va, sizeof(u64))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__get_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
DITOREG(val, MIPSInst_RT(ir)); DITOREG(val, MIPSInst_RT(ir));
break; break;
} }
@ -284,10 +304,16 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
MIPS_FPU_EMU_INC_STATS(stores); MIPS_FPU_EMU_INC_STATS(stores);
DIFROMREG(val, MIPSInst_RT(ir)); DIFROMREG(val, MIPSInst_RT(ir));
if (put_user(val, va)) { if (!access_ok(VERIFY_WRITE, va, sizeof(u64))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__put_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
break; break;
} }
@ -297,10 +323,16 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
u32 val; u32 val;
MIPS_FPU_EMU_INC_STATS(loads); MIPS_FPU_EMU_INC_STATS(loads);
if (get_user(val, va)) { if (!access_ok(VERIFY_READ, va, sizeof(u32))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__get_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
SITOREG(val, MIPSInst_RT(ir)); SITOREG(val, MIPSInst_RT(ir));
break; break;
} }
@ -312,10 +344,16 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
MIPS_FPU_EMU_INC_STATS(stores); MIPS_FPU_EMU_INC_STATS(stores);
SIFROMREG(val, MIPSInst_RT(ir)); SIFROMREG(val, MIPSInst_RT(ir));
if (put_user(val, va)) { if (!access_ok(VERIFY_WRITE, va, sizeof(u32))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__put_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
break; break;
} }
@ -440,10 +478,17 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
contpc = (xcp->cp0_epc + contpc = (xcp->cp0_epc +
(MIPSInst_SIMM(ir) << 2)); (MIPSInst_SIMM(ir) << 2));
if (get_user(ir, if (!access_ok(VERIFY_READ, xcp->cp0_epc,
sizeof(mips_instruction))) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)xcp->cp0_epc;
return SIGBUS;
}
if (__get_user(ir,
(mips_instruction __user *) xcp->cp0_epc)) { (mips_instruction __user *) xcp->cp0_epc)) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
return SIGBUS; *fault_addr = (mips_instruction __user *)xcp->cp0_epc;
return SIGSEGV;
} }
switch (MIPSInst_OPCODE(ir)) { switch (MIPSInst_OPCODE(ir)) {
@ -506,9 +551,8 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
#if __mips >= 4 && __mips != 32 #if __mips >= 4 && __mips != 32
case cop1x_op:{ case cop1x_op:{
int sig; int sig = fpux_emu(xcp, ctx, ir, fault_addr);
if (sig)
if ((sig = fpux_emu(xcp, ctx, ir)))
return sig; return sig;
break; break;
} }
@ -604,7 +648,7 @@ DEF3OP(nmadd, dp, ieee754dp_mul, ieee754dp_add, ieee754dp_neg);
DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg); DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
mips_instruction ir) mips_instruction ir, void *__user *fault_addr)
{ {
unsigned rcsr = 0; /* resulting csr */ unsigned rcsr = 0; /* resulting csr */
@ -624,10 +668,16 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
xcp->regs[MIPSInst_FT(ir)]); xcp->regs[MIPSInst_FT(ir)]);
MIPS_FPU_EMU_INC_STATS(loads); MIPS_FPU_EMU_INC_STATS(loads);
if (get_user(val, va)) { if (!access_ok(VERIFY_READ, va, sizeof(u32))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__get_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
SITOREG(val, MIPSInst_FD(ir)); SITOREG(val, MIPSInst_FD(ir));
break; break;
@ -638,9 +688,15 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
MIPS_FPU_EMU_INC_STATS(stores); MIPS_FPU_EMU_INC_STATS(stores);
SIFROMREG(val, MIPSInst_FS(ir)); SIFROMREG(val, MIPSInst_FS(ir));
if (!access_ok(VERIFY_WRITE, va, sizeof(u32))) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS;
}
if (put_user(val, va)) { if (put_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
return SIGBUS; *fault_addr = va;
return SIGSEGV;
} }
break; break;
@ -701,10 +757,16 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
xcp->regs[MIPSInst_FT(ir)]); xcp->regs[MIPSInst_FT(ir)]);
MIPS_FPU_EMU_INC_STATS(loads); MIPS_FPU_EMU_INC_STATS(loads);
if (get_user(val, va)) { if (!access_ok(VERIFY_READ, va, sizeof(u64))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__get_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
DITOREG(val, MIPSInst_FD(ir)); DITOREG(val, MIPSInst_FD(ir));
break; break;
@ -714,10 +776,16 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
MIPS_FPU_EMU_INC_STATS(stores); MIPS_FPU_EMU_INC_STATS(stores);
DIFROMREG(val, MIPSInst_FS(ir)); DIFROMREG(val, MIPSInst_FS(ir));
if (put_user(val, va)) { if (!access_ok(VERIFY_WRITE, va, sizeof(u64))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGBUS; return SIGBUS;
} }
if (__put_user(val, va)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = va;
return SIGSEGV;
}
break; break;
case madd_d_op: case madd_d_op:
@ -1242,7 +1310,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
} }
int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx, int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
int has_fpu) int has_fpu, void *__user *fault_addr)
{ {
unsigned long oldepc, prevepc; unsigned long oldepc, prevepc;
mips_instruction insn; mips_instruction insn;
@ -1252,10 +1320,16 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
do { do {
prevepc = xcp->cp0_epc; prevepc = xcp->cp0_epc;
if (get_user(insn, (mips_instruction __user *) xcp->cp0_epc)) { if (!access_ok(VERIFY_READ, xcp->cp0_epc, sizeof(mips_instruction))) {
MIPS_FPU_EMU_INC_STATS(errors); MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)xcp->cp0_epc;
return SIGBUS; return SIGBUS;
} }
if (__get_user(insn, (mips_instruction __user *) xcp->cp0_epc)) {
MIPS_FPU_EMU_INC_STATS(errors);
*fault_addr = (mips_instruction __user *)xcp->cp0_epc;
return SIGSEGV;
}
if (insn == 0) if (insn == 0)
xcp->cp0_epc += 4; /* skip nops */ xcp->cp0_epc += 4; /* skip nops */
else { else {
@ -1267,7 +1341,7 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
*/ */
/* convert to ieee library modes */ /* convert to ieee library modes */
ieee754_csr.rm = ieee_rm[ieee754_csr.rm]; ieee754_csr.rm = ieee_rm[ieee754_csr.rm];
sig = cop1Emulate(xcp, ctx); sig = cop1Emulate(xcp, ctx, fault_addr);
/* revert to mips rounding mode */ /* revert to mips rounding mode */
ieee754_csr.rm = mips_rm[ieee754_csr.rm]; ieee754_csr.rm = mips_rm[ieee754_csr.rm];
} }

View File

@ -288,7 +288,7 @@ int mips_dma_supported(struct device *dev, u64 mask)
return plat_dma_supported(dev, mask); return plat_dma_supported(dev, mask);
} }
void mips_dma_cache_sync(struct device *dev, void *vaddr, size_t size, void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction direction) enum dma_data_direction direction)
{ {
BUG_ON(direction == DMA_NONE); BUG_ON(direction == DMA_NONE);
@ -298,6 +298,8 @@ void mips_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
__dma_sync((unsigned long)vaddr, size, direction); __dma_sync((unsigned long)vaddr, size, direction);
} }
EXPORT_SYMBOL(dma_cache_sync);
static struct dma_map_ops mips_default_dma_map_ops = { static struct dma_map_ops mips_default_dma_map_ops = {
.alloc_coherent = mips_dma_alloc_coherent, .alloc_coherent = mips_dma_alloc_coherent,
.free_coherent = mips_dma_free_coherent, .free_coherent = mips_dma_free_coherent,

View File

@ -68,6 +68,9 @@ static struct bcache_ops mips_sc_ops = {
*/ */
static inline int mips_sc_is_activated(struct cpuinfo_mips *c) static inline int mips_sc_is_activated(struct cpuinfo_mips *c)
{ {
unsigned int config2 = read_c0_config2();
unsigned int tmp;
/* Check the bypass bit (L2B) */ /* Check the bypass bit (L2B) */
switch (c->cputype) { switch (c->cputype) {
case CPU_34K: case CPU_34K:
@ -83,6 +86,7 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c)
c->scache.linesz = 2 << tmp; c->scache.linesz = 2 << tmp;
else else
return 0; return 0;
return 1;
} }
static inline int __init mips_sc_probe(void) static inline int __init mips_sc_probe(void)

View File

@ -65,11 +65,15 @@ static unsigned char readb_outer_space(unsigned long long phys)
__asm__ __volatile__ ( __asm__ __volatile__ (
" .set mips3 \n" " .set mips3 \n"
" .set push \n"
" .set noreorder \n"
" .set nomacro \n"
" ld %0, %1 \n" " ld %0, %1 \n"
" .set pop \n"
" lbu %0, (%0) \n" " lbu %0, (%0) \n"
" .set mips0 \n" " .set mips0 \n"
: "=r" (res) : "=r" (res)
: "m" (vaddr)); : "R" (vaddr));
write_c0_status(sr); write_c0_status(sr);
ssnop_4(); ssnop_4();
@ -89,11 +93,15 @@ static void writeb_outer_space(unsigned long long phys, unsigned char c)
__asm__ __volatile__ ( __asm__ __volatile__ (
" .set mips3 \n" " .set mips3 \n"
" .set push \n"
" .set noreorder \n"
" .set nomacro \n"
" ld %0, %1 \n" " ld %0, %1 \n"
" .set pop \n"
" sb %2, (%0) \n" " sb %2, (%0) \n"
" .set mips0 \n" " .set mips0 \n"
: "=&r" (tmp) : "=&r" (tmp)
: "m" (vaddr), "r" (c)); : "R" (vaddr), "r" (c));
write_c0_status(sr); write_c0_status(sr);
ssnop_4(); ssnop_4();

View File

@ -82,7 +82,7 @@ int swarm_be_handler(struct pt_regs *regs, int is_fixup)
enum swarm_rtc_type { enum swarm_rtc_type {
RTC_NONE, RTC_NONE,
RTC_XICOR, RTC_XICOR,
RTC_M4LT81 RTC_M41T81,
}; };
enum swarm_rtc_type swarm_rtc_type; enum swarm_rtc_type swarm_rtc_type;
@ -96,7 +96,7 @@ void read_persistent_clock(struct timespec *ts)
sec = xicor_get_time(); sec = xicor_get_time();
break; break;
case RTC_M4LT81: case RTC_M41T81:
sec = m41t81_get_time(); sec = m41t81_get_time();
break; break;
@ -115,7 +115,7 @@ int rtc_mips_set_time(unsigned long sec)
case RTC_XICOR: case RTC_XICOR:
return xicor_set_time(sec); return xicor_set_time(sec);
case RTC_M4LT81: case RTC_M41T81:
return m41t81_set_time(sec); return m41t81_set_time(sec);
case RTC_NONE: case RTC_NONE:
@ -141,7 +141,7 @@ void __init plat_mem_setup(void)
if (xicor_probe()) if (xicor_probe())
swarm_rtc_type = RTC_XICOR; swarm_rtc_type = RTC_XICOR;
if (m41t81_probe()) if (m41t81_probe())
swarm_rtc_type = RTC_M4LT81; swarm_rtc_type = RTC_M41T81;
#ifdef CONFIG_VT #ifdef CONFIG_VT
screen_info = (struct screen_info) { screen_info = (struct screen_info) {

View File

@ -40,21 +40,17 @@ unsigned long long sched_clock(void)
unsigned long long ll; unsigned long long ll;
unsigned l[2]; unsigned l[2];
} tsc64, result; } tsc64, result;
unsigned long tsc, tmp; unsigned long tmp;
unsigned product[3]; /* 96-bit intermediate value */ unsigned product[3]; /* 96-bit intermediate value */
/* cnt32_to_63() is not safe with preemption */ /* cnt32_to_63() is not safe with preemption */
preempt_disable(); preempt_disable();
/* read the TSC value /* expand the tsc to 64-bits.
*/
tsc = get_cycles();
/* expand to 64-bits.
* - sched_clock() must be called once a minute or better or the * - sched_clock() must be called once a minute or better or the
* following will go horribly wrong - see cnt32_to_63() * following will go horribly wrong - see cnt32_to_63()
*/ */
tsc64.ll = cnt32_to_63(tsc) & 0x7fffffffffffffffULL; tsc64.ll = cnt32_to_63(get_cycles()) & 0x7fffffffffffffffULL;
preempt_enable(); preempt_enable();

View File

@ -22,7 +22,8 @@ config SUPERH
select HAVE_SPARSE_IRQ select HAVE_SPARSE_IRQ
select RTC_LIB select RTC_LIB
select GENERIC_ATOMIC64 select GENERIC_ATOMIC64
select GENERIC_HARDIRQS_NO_DEPRECATED # Support the deprecated APIs until MFD and GPIOLIB catch up.
select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB
help help
The SuperH is a RISC processor targeted for use in embedded systems The SuperH is a RISC processor targeted for use in embedded systems
and consumer electronics; it was also used in the Sega Dreamcast and consumer electronics; it was also used in the Sega Dreamcast

View File

@ -368,8 +368,9 @@
#define __NR_sendmsg 355 #define __NR_sendmsg 355
#define __NR_recvmsg 356 #define __NR_recvmsg 356
#define __NR_recvmmsg 357 #define __NR_recvmmsg 357
#define __NR_accept4 358
#define NR_syscalls 358 #define NR_syscalls 359
#ifdef __KERNEL__ #ifdef __KERNEL__

View File

@ -375,3 +375,4 @@ ENTRY(sys_call_table)
.long sys_sendmsg /* 355 */ .long sys_sendmsg /* 355 */
.long sys_recvmsg .long sys_recvmsg
.long sys_recvmmsg .long sys_recvmmsg
.long sys_accept4

View File

@ -39,7 +39,7 @@ struct linux_dev_v2_funcs {
int (*v2_dev_open)(char *devpath); int (*v2_dev_open)(char *devpath);
void (*v2_dev_close)(int d); void (*v2_dev_close)(int d);
int (*v2_dev_read)(int d, char *buf, int nbytes); int (*v2_dev_read)(int d, char *buf, int nbytes);
int (*v2_dev_write)(int d, char *buf, int nbytes); int (*v2_dev_write)(int d, const char *buf, int nbytes);
int (*v2_dev_seek)(int d, int hi, int lo); int (*v2_dev_seek)(int d, int hi, int lo);
/* Never issued (multistage load support) */ /* Never issued (multistage load support) */

View File

@ -60,25 +60,6 @@ extern char *prom_getbootargs(void);
extern char *prom_mapio(char *virt_hint, int io_space, unsigned int phys_addr, unsigned int num_bytes); extern char *prom_mapio(char *virt_hint, int io_space, unsigned int phys_addr, unsigned int num_bytes);
extern void prom_unmapio(char *virt_addr, unsigned int num_bytes); extern void prom_unmapio(char *virt_addr, unsigned int num_bytes);
/* Device operations. */
/* Open the device described by the passed string. Note, that the format
* of the string is different on V0 vs. V2->higher proms. The caller must
* know what he/she is doing! Returns the device descriptor, an int.
*/
extern int prom_devopen(char *device_string);
/* Close a previously opened device described by the passed integer
* descriptor.
*/
extern int prom_devclose(int device_handle);
/* Do a seek operation on the device described by the passed integer
* descriptor.
*/
extern void prom_seek(int device_handle, unsigned int seek_hival,
unsigned int seek_lowval);
/* Miscellaneous routines, don't really fit in any category per se. */ /* Miscellaneous routines, don't really fit in any category per se. */
/* Reboot the machine with the command line passed. */ /* Reboot the machine with the command line passed. */
@ -121,19 +102,8 @@ extern int prom_getrev(void);
/* Get the prom firmware revision. */ /* Get the prom firmware revision. */
extern int prom_getprev(void); extern int prom_getprev(void);
/* Character operations to/from the console.... */ /* Write a buffer of characters to the console. */
extern void prom_console_write_buf(const char *buf, int len);
/* Non-blocking get character from console. */
extern int prom_nbgetchar(void);
/* Non-blocking put character to console. */
extern int prom_nbputchar(char character);
/* Blocking get character from console. */
extern char prom_getchar(void);
/* Blocking put character to console. */
extern void prom_putchar(char character);
/* Prom's internal routines, don't use in kernel/boot code. */ /* Prom's internal routines, don't use in kernel/boot code. */
extern void prom_printf(const char *fmt, ...); extern void prom_printf(const char *fmt, ...);
@ -238,7 +208,6 @@ extern int prom_node_has_property(phandle node, char *property);
extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, extern int prom_setprop(phandle node, const char *prop_name, char *prop_value,
int value_size); int value_size);
extern phandle prom_pathtoinode(char *path);
extern phandle prom_inst2pkg(int); extern phandle prom_inst2pkg(int);
/* Dorking with Bus ranges... */ /* Dorking with Bus ranges... */

View File

@ -67,27 +67,6 @@ extern void prom_init(void *cif_handler, void *cif_stack);
/* Boot argument acquisition, returns the boot command line string. */ /* Boot argument acquisition, returns the boot command line string. */
extern char *prom_getbootargs(void); extern char *prom_getbootargs(void);
/* Device utilities. */
/* Device operations. */
/* Open the device described by the passed string. Note, that the format
* of the string is different on V0 vs. V2->higher proms. The caller must
* know what he/she is doing! Returns the device descriptor, an int.
*/
extern int prom_devopen(const char *device_string);
/* Close a previously opened device described by the passed integer
* descriptor.
*/
extern int prom_devclose(int device_handle);
/* Do a seek operation on the device described by the passed integer
* descriptor.
*/
extern void prom_seek(int device_handle, unsigned int seek_hival,
unsigned int seek_lowval);
/* Miscellaneous routines, don't really fit in any category per se. */ /* Miscellaneous routines, don't really fit in any category per se. */
/* Reboot the machine with the command line passed. */ /* Reboot the machine with the command line passed. */
@ -109,33 +88,14 @@ extern void prom_halt(void) __attribute__ ((noreturn));
/* Halt and power-off the machine. */ /* Halt and power-off the machine. */
extern void prom_halt_power_off(void) __attribute__ ((noreturn)); extern void prom_halt_power_off(void) __attribute__ ((noreturn));
/* Set the PROM 'sync' callback function to the passed function pointer.
* When the user gives the 'sync' command at the prom prompt while the
* kernel is still active, the prom will call this routine.
*
*/
typedef int (*callback_func_t)(long *cmd);
extern void prom_setcallback(callback_func_t func_ptr);
/* Acquire the IDPROM of the root node in the prom device tree. This /* Acquire the IDPROM of the root node in the prom device tree. This
* gets passed a buffer where you would like it stuffed. The return value * gets passed a buffer where you would like it stuffed. The return value
* is the format type of this idprom or 0xff on error. * is the format type of this idprom or 0xff on error.
*/ */
extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);
/* Character operations to/from the console.... */ /* Write a buffer of characters to the console. */
extern void prom_console_write_buf(const char *buf, int len);
/* Non-blocking get character from console. */
extern int prom_nbgetchar(void);
/* Non-blocking put character to console. */
extern int prom_nbputchar(char character);
/* Blocking get character from console. */
extern char prom_getchar(void);
/* Blocking put character to console. */
extern void prom_putchar(char character);
/* Prom's internal routines, don't use in kernel/boot code. */ /* Prom's internal routines, don't use in kernel/boot code. */
extern void prom_printf(const char *fmt, ...); extern void prom_printf(const char *fmt, ...);
@ -279,9 +239,7 @@ extern phandle prom_finddevice(const char *name);
extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, extern int prom_setprop(phandle node, const char *prop_name, char *prop_value,
int value_size); int value_size);
extern phandle prom_pathtoinode(const char *path);
extern phandle prom_inst2pkg(int); extern phandle prom_inst2pkg(int);
extern int prom_service_exists(const char *service_name);
extern void prom_sun4v_guest_soft_state(void); extern void prom_sun4v_guest_soft_state(void);
extern int prom_ihandle2path(int handle, char *buffer, int bufsize); extern int prom_ihandle2path(int handle, char *buffer, int bufsize);

View File

@ -114,7 +114,7 @@ void __init leon_init_timers(irq_handler_t counter_fn)
if (leon3_gptimer_regs && leon3_irqctrl_regs) { if (leon3_gptimer_regs && leon3_irqctrl_regs) {
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].val, 0); LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].val, 0);
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].rld, LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].rld,
(((1000000 / 100) - 1))); (((1000000 / HZ) - 1)));
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0); LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
@ -128,7 +128,7 @@ void __init leon_init_timers(irq_handler_t counter_fn)
} }
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].val, 0); LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].val, 0);
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/100) - 1))); LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/HZ) - 1)));
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0); LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0);
# endif # endif

View File

@ -6,7 +6,6 @@ ccflags := -Werror
lib-y := bootstr_$(BITS).o lib-y := bootstr_$(BITS).o
lib-$(CONFIG_SPARC32) += devmap.o lib-$(CONFIG_SPARC32) += devmap.o
lib-y += devops_$(BITS).o
lib-y += init_$(BITS).o lib-y += init_$(BITS).o
lib-$(CONFIG_SPARC32) += memory.o lib-$(CONFIG_SPARC32) += memory.o
lib-y += misc_$(BITS).o lib-y += misc_$(BITS).o

View File

@ -16,63 +16,26 @@
extern void restore_current(void); extern void restore_current(void);
/* Non blocking get character from console input device, returns -1
* if no input was taken. This can be used for polling.
*/
int
prom_nbgetchar(void)
{
static char inc;
int i = -1;
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
switch(prom_vers) {
case PROM_V0:
i = (*(romvec->pv_nbgetchar))();
break;
case PROM_V2:
case PROM_V3:
if( (*(romvec->pv_v2devops).v2_dev_read)(*romvec->pv_v2bootargs.fd_stdin , &inc, 0x1) == 1) {
i = inc;
} else {
i = -1;
}
break;
default:
i = -1;
break;
};
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
return i; /* Ugh, we could spin forever on unsupported proms ;( */
}
/* Non blocking put character to console device, returns -1 if /* Non blocking put character to console device, returns -1 if
* unsuccessful. * unsuccessful.
*/ */
int static int prom_nbputchar(const char *buf)
prom_nbputchar(char c)
{ {
static char outc;
unsigned long flags; unsigned long flags;
int i = -1; int i = -1;
spin_lock_irqsave(&prom_lock, flags); spin_lock_irqsave(&prom_lock, flags);
switch(prom_vers) { switch(prom_vers) {
case PROM_V0: case PROM_V0:
i = (*(romvec->pv_nbputchar))(c); i = (*(romvec->pv_nbputchar))(*buf);
break; break;
case PROM_V2: case PROM_V2:
case PROM_V3: case PROM_V3:
outc = c; if ((*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout,
if( (*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout, &outc, 0x1) == 1) buf, 0x1) == 1)
i = 0; i = 0;
else
i = -1;
break; break;
default: default:
i = -1;
break; break;
}; };
restore_current(); restore_current();
@ -80,18 +43,14 @@ prom_nbputchar(char c)
return i; /* Ugh, we could spin forever on unsupported proms ;( */ return i; /* Ugh, we could spin forever on unsupported proms ;( */
} }
/* Blocking version of get character routine above. */ void prom_console_write_buf(const char *buf, int len)
char
prom_getchar(void)
{ {
int character; while (len) {
while((character = prom_nbgetchar()) == -1) ; int n = prom_nbputchar(buf);
return (char) character; if (n)
continue;
len--;
buf++;
}
} }
/* Blocking version of put character routine above. */
void
prom_putchar(char c)
{
while(prom_nbputchar(c) == -1) ;
}

View File

@ -15,85 +15,34 @@
extern int prom_stdin, prom_stdout; extern int prom_stdin, prom_stdout;
/* Non blocking get character from console input device, returns -1 static int __prom_console_write_buf(const char *buf, int len)
* if no input was taken. This can be used for polling.
*/
inline int
prom_nbgetchar(void)
{ {
unsigned long args[7]; unsigned long args[7];
char inc; int ret;
args[0] = (unsigned long) "read";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) prom_stdin;
args[4] = (unsigned long) &inc;
args[5] = 1;
args[6] = (unsigned long) -1;
p1275_cmd_direct(args);
if (args[6] == 1)
return inc;
return -1;
}
/* Non blocking put character to console device, returns -1 if
* unsuccessful.
*/
inline int
prom_nbputchar(char c)
{
unsigned long args[7];
char outc;
outc = c;
args[0] = (unsigned long) "write"; args[0] = (unsigned long) "write";
args[1] = 3; args[1] = 3;
args[2] = 1; args[2] = 1;
args[3] = (unsigned int) prom_stdout; args[3] = (unsigned int) prom_stdout;
args[4] = (unsigned long) &outc; args[4] = (unsigned long) buf;
args[5] = 1; args[5] = (unsigned int) len;
args[6] = (unsigned long) -1; args[6] = (unsigned long) -1;
p1275_cmd_direct(args); p1275_cmd_direct(args);
if (args[6] == 1) ret = (int) args[6];
return 0; if (ret < 0)
else
return -1; return -1;
return ret;
} }
/* Blocking version of get character routine above. */ void prom_console_write_buf(const char *buf, int len)
char
prom_getchar(void)
{ {
int character; while (len) {
while((character = prom_nbgetchar()) == -1) ; int n = __prom_console_write_buf(buf, len);
return (char) character; if (n < 0)
} continue;
len -= n;
/* Blocking version of put character routine above. */ buf += len;
void }
prom_putchar(char c)
{
prom_nbputchar(c);
}
void
prom_puts(const char *s, int len)
{
unsigned long args[7];
args[0] = (unsigned long) "write";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) prom_stdout;
args[4] = (unsigned long) s;
args[5] = len;
args[6] = (unsigned long) -1;
p1275_cmd_direct(args);
} }

View File

@ -1,87 +0,0 @@
/*
* devops.c: Device operations using the PROM.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
extern void restore_current(void);
/* Open the device described by the string 'dstr'. Returns the handle
* to that device used for subsequent operations on that device.
* Returns -1 on failure.
*/
int
prom_devopen(char *dstr)
{
int handle;
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
switch(prom_vers) {
case PROM_V0:
handle = (*(romvec->pv_v0devops.v0_devopen))(dstr);
if(handle == 0) handle = -1;
break;
case PROM_V2:
case PROM_V3:
handle = (*(romvec->pv_v2devops.v2_dev_open))(dstr);
break;
default:
handle = -1;
break;
};
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
return handle;
}
/* Close the device described by device handle 'dhandle'. */
int
prom_devclose(int dhandle)
{
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
switch(prom_vers) {
case PROM_V0:
(*(romvec->pv_v0devops.v0_devclose))(dhandle);
break;
case PROM_V2:
case PROM_V3:
(*(romvec->pv_v2devops.v2_dev_close))(dhandle);
break;
default:
break;
};
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
return 0;
}
/* Seek to specified location described by 'seekhi' and 'seeklo'
* for device 'dhandle'.
*/
void
prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
{
unsigned long flags;
spin_lock_irqsave(&prom_lock, flags);
switch(prom_vers) {
case PROM_V0:
(*(romvec->pv_v0devops.v0_seekdev))(dhandle, seekhi, seeklo);
break;
case PROM_V2:
case PROM_V3:
(*(romvec->pv_v2devops.v2_dev_seek))(dhandle, seekhi, seeklo);
break;
default:
break;
};
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
}

View File

@ -1,67 +0,0 @@
/*
* devops.c: Device operations using the PROM.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
/* Open the device described by the string 'dstr'. Returns the handle
* to that device used for subsequent operations on that device.
* Returns 0 on failure.
*/
int
prom_devopen(const char *dstr)
{
unsigned long args[5];
args[0] = (unsigned long) "open";
args[1] = 1;
args[2] = 1;
args[3] = (unsigned long) dstr;
args[4] = (unsigned long) -1;
p1275_cmd_direct(args);
return (int) args[4];
}
/* Close the device described by device handle 'dhandle'. */
int
prom_devclose(int dhandle)
{
unsigned long args[4];
args[0] = (unsigned long) "close";
args[1] = 1;
args[2] = 0;
args[3] = (unsigned int) dhandle;
p1275_cmd_direct(args);
return 0;
}
/* Seek to specified location described by 'seekhi' and 'seeklo'
* for device 'dhandle'.
*/
void
prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
{
unsigned long args[7];
args[0] = (unsigned long) "seek";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) dhandle;
args[4] = seekhi;
args[5] = seeklo;
args[6] = (unsigned long) -1;
p1275_cmd_direct(args);
}

View File

@ -18,7 +18,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/ldc.h> #include <asm/ldc.h>
int prom_service_exists(const char *service_name) static int prom_service_exists(const char *service_name)
{ {
unsigned long args[5]; unsigned long args[5];
@ -150,20 +150,6 @@ void prom_halt_power_off(void)
prom_halt(); prom_halt();
} }
/* Set prom sync handler to call function 'funcp'. */
void prom_setcallback(callback_func_t funcp)
{
unsigned long args[5];
if (!funcp)
return;
args[0] = (unsigned long) "set-callback";
args[1] = 1;
args[2] = 1;
args[3] = (unsigned long) funcp;
args[4] = (unsigned long) -1;
p1275_cmd_direct(args);
}
/* Get the idprom and stuff it into buffer 'idbuf'. Returns the /* Get the idprom and stuff it into buffer 'idbuf'. Returns the
* format type. 'num_bytes' is the number of bytes that your idbuf * format type. 'num_bytes' is the number of bytes that your idbuf
* has space for. Returns 0xff on error. * has space for. Returns 0xff on error.

View File

@ -15,22 +15,45 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/spinlock.h>
#include <asm/openprom.h> #include <asm/openprom.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#define CONSOLE_WRITE_BUF_SIZE 1024
static char ppbuf[1024]; static char ppbuf[1024];
static char console_write_buf[CONSOLE_WRITE_BUF_SIZE];
static DEFINE_RAW_SPINLOCK(console_write_lock);
void notrace prom_write(const char *buf, unsigned int n) void notrace prom_write(const char *buf, unsigned int n)
{ {
char ch; unsigned int dest_len;
unsigned long flags;
char *dest;
while (n != 0) { dest = console_write_buf;
--n; raw_spin_lock_irqsave(&console_write_lock, flags);
if ((ch = *buf++) == '\n')
prom_putchar('\r'); dest_len = 0;
prom_putchar(ch); while (n-- != 0) {
char ch = *buf++;
if (ch == '\n') {
*dest++ = '\r';
dest_len++;
}
*dest++ = ch;
dest_len++;
if (dest_len >= CONSOLE_WRITE_BUF_SIZE - 1) {
prom_console_write_buf(console_write_buf, dest_len);
dest = console_write_buf;
dest_len = 0;
}
} }
if (dest_len)
prom_console_write_buf(console_write_buf, dest_len);
raw_spin_unlock_irqrestore(&console_write_lock, flags);
} }
void notrace prom_printf(const char *fmt, ...) void notrace prom_printf(const char *fmt, ...)

View File

@ -342,19 +342,3 @@ phandle prom_inst2pkg(int inst)
if (node == -1) return 0; if (node == -1) return 0;
return node; return node;
} }
/* Return 'node' assigned to a particular prom 'path'
* FIXME: Should work for v0 as well
*/
phandle prom_pathtoinode(char *path)
{
phandle node;
int inst;
inst = prom_devopen (path);
if (inst == -1) return 0;
node = prom_inst2pkg (inst);
prom_devclose (inst);
if (node == -1) return 0;
return node;
}

View File

@ -374,24 +374,6 @@ inline phandle prom_inst2pkg(int inst)
return node; return node;
} }
/* Return 'node' assigned to a particular prom 'path'
* FIXME: Should work for v0 as well
*/
phandle prom_pathtoinode(const char *path)
{
phandle node;
int inst;
inst = prom_devopen (path);
if (inst == 0)
return 0;
node = prom_inst2pkg(inst);
prom_devclose(inst);
if (node == -1)
return 0;
return node;
}
int prom_ihandle2path(int handle, char *buffer, int bufsize) int prom_ihandle2path(int handle, char *buffer, int bufsize)
{ {
unsigned long args[7]; unsigned long args[7];

View File

@ -25,7 +25,7 @@
#if defined(__KERNEL__) && !defined(__ASSEMBLY__) #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
struct pt_regs; struct pt_regs;
int restore_sigcontext(struct pt_regs *, struct sigcontext __user *, long *); int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); int setup_sigcontext(struct sigcontext __user *, struct pt_regs *);
void do_signal(struct pt_regs *regs); void do_signal(struct pt_regs *regs);
#endif #endif

View File

@ -290,12 +290,12 @@ long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr,
return ret; return ret;
} }
/* The assembly shim for this function arranges to ignore the return value. */
long compat_sys_rt_sigreturn(struct pt_regs *regs) long compat_sys_rt_sigreturn(struct pt_regs *regs)
{ {
struct compat_rt_sigframe __user *frame = struct compat_rt_sigframe __user *frame =
(struct compat_rt_sigframe __user *) compat_ptr(regs->sp); (struct compat_rt_sigframe __user *) compat_ptr(regs->sp);
sigset_t set; sigset_t set;
long r0;
if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe; goto badframe;
@ -308,13 +308,13 @@ long compat_sys_rt_sigreturn(struct pt_regs *regs)
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe; goto badframe;
if (compat_sys_sigaltstack(&frame->uc.uc_stack, NULL, regs) != 0) if (compat_sys_sigaltstack(&frame->uc.uc_stack, NULL, regs) != 0)
goto badframe; goto badframe;
return r0; return 0;
badframe: badframe:
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);

View File

@ -1342,8 +1342,8 @@ handle_syscall:
lw r20, r20 lw r20, r20
/* Jump to syscall handler. */ /* Jump to syscall handler. */
jalr r20; .Lhandle_syscall_link: jalr r20
FEEDBACK_REENTER(handle_syscall) .Lhandle_syscall_link: /* value of "lr" after "jalr r20" above */
/* /*
* Write our r0 onto the stack so it gets restored instead * Write our r0 onto the stack so it gets restored instead
@ -1352,6 +1352,9 @@ handle_syscall:
PTREGS_PTR(r29, PTREGS_OFFSET_REG(0)) PTREGS_PTR(r29, PTREGS_OFFSET_REG(0))
sw r29, r0 sw r29, r0
.Lsyscall_sigreturn_skip:
FEEDBACK_REENTER(handle_syscall)
/* Do syscall trace again, if requested. */ /* Do syscall trace again, if requested. */
lw r30, r31 lw r30, r31
andi r30, r30, _TIF_SYSCALL_TRACE andi r30, r30, _TIF_SYSCALL_TRACE
@ -1536,9 +1539,24 @@ STD_ENTRY_LOCAL(bad_intr)
}; \ }; \
STD_ENDPROC(_##x) STD_ENDPROC(_##x)
/*
* Special-case sigreturn to not write r0 to the stack on return.
* This is technically more efficient, but it also avoids difficulties
* in the 64-bit OS when handling 32-bit compat code, since we must not
* sign-extend r0 for the sigreturn return-value case.
*/
#define PTREGS_SYSCALL_SIGRETURN(x, reg) \
STD_ENTRY(_##x); \
addli lr, lr, .Lsyscall_sigreturn_skip - .Lhandle_syscall_link; \
{ \
PTREGS_PTR(reg, PTREGS_OFFSET_BASE); \
j x \
}; \
STD_ENDPROC(_##x)
PTREGS_SYSCALL(sys_execve, r3) PTREGS_SYSCALL(sys_execve, r3)
PTREGS_SYSCALL(sys_sigaltstack, r2) PTREGS_SYSCALL(sys_sigaltstack, r2)
PTREGS_SYSCALL(sys_rt_sigreturn, r0) PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0)
PTREGS_SYSCALL(sys_cmpxchg_badaddr, r1) PTREGS_SYSCALL(sys_cmpxchg_badaddr, r1)
/* Save additional callee-saves to pt_regs, put address in r4 and jump. */ /* Save additional callee-saves to pt_regs, put address in r4 and jump. */

View File

@ -211,6 +211,13 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
childregs->regs[0] = 0; /* return value is zero */ childregs->regs[0] = 0; /* return value is zero */
childregs->sp = sp; /* override with new user stack pointer */ childregs->sp = sp; /* override with new user stack pointer */
/*
* If CLONE_SETTLS is set, set "tp" in the new task to "r4",
* which is passed in as arg #5 to sys_clone().
*/
if (clone_flags & CLONE_SETTLS)
childregs->tp = regs->regs[4];
/* /*
* Copy the callee-saved registers from the passed pt_regs struct * Copy the callee-saved registers from the passed pt_regs struct
* into the context-switch callee-saved registers area. * into the context-switch callee-saved registers area.
@ -539,6 +546,7 @@ struct task_struct *__sched _switch_to(struct task_struct *prev,
return __switch_to(prev, next, next_current_ksp0(next)); return __switch_to(prev, next, next_current_ksp0(next));
} }
/* Note there is an implicit fifth argument if (clone_flags & CLONE_SETTLS). */
SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
void __user *, parent_tidptr, void __user *, child_tidptr, void __user *, parent_tidptr, void __user *, child_tidptr,
struct pt_regs *, regs) struct pt_regs *, regs)

View File

@ -52,7 +52,7 @@ SYSCALL_DEFINE3(sigaltstack, const stack_t __user *, uss,
*/ */
int restore_sigcontext(struct pt_regs *regs, int restore_sigcontext(struct pt_regs *regs,
struct sigcontext __user *sc, long *pr0) struct sigcontext __user *sc)
{ {
int err = 0; int err = 0;
int i; int i;
@ -75,17 +75,15 @@ int restore_sigcontext(struct pt_regs *regs,
regs->faultnum = INT_SWINT_1_SIGRETURN; regs->faultnum = INT_SWINT_1_SIGRETURN;
err |= __get_user(*pr0, &sc->gregs[0]);
return err; return err;
} }
/* sigreturn() returns long since it restores r0 in the interrupted code. */ /* The assembly shim for this function arranges to ignore the return value. */
SYSCALL_DEFINE1(rt_sigreturn, struct pt_regs *, regs) SYSCALL_DEFINE1(rt_sigreturn, struct pt_regs *, regs)
{ {
struct rt_sigframe __user *frame = struct rt_sigframe __user *frame =
(struct rt_sigframe __user *)(regs->sp); (struct rt_sigframe __user *)(regs->sp);
sigset_t set; sigset_t set;
long r0;
if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
goto badframe; goto badframe;
@ -98,13 +96,13 @@ SYSCALL_DEFINE1(rt_sigreturn, struct pt_regs *, regs)
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe; goto badframe;
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
goto badframe; goto badframe;
return r0; return 0;
badframe: badframe:
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);

View File

@ -355,7 +355,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
if (heap > 0x3fffffffffffUL) if (heap > 0x3fffffffffffUL)
error("Destination address too large"); error("Destination address too large");
#else #else
if (heap > ((-__PAGE_OFFSET-(512<<20)-1) & 0x7fffffff)) if (heap > ((-__PAGE_OFFSET-(128<<20)-1) & 0x7fffffff))
error("Destination address too large"); error("Destination address too large");
#endif #endif
#ifndef CONFIG_RELOCATABLE #ifndef CONFIG_RELOCATABLE

View File

@ -10,6 +10,7 @@
* by the Free Software Foundation. * by the Free Software Foundation.
*/ */
#include <linux/err.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>

View File

@ -72,6 +72,9 @@ struct e820map {
#define BIOS_BEGIN 0x000a0000 #define BIOS_BEGIN 0x000a0000
#define BIOS_END 0x00100000 #define BIOS_END 0x00100000
#define BIOS_ROM_BASE 0xffe00000
#define BIOS_ROM_END 0xffffffff
#ifdef __KERNEL__ #ifdef __KERNEL__
/* see comment in arch/x86/kernel/e820.c */ /* see comment in arch/x86/kernel/e820.c */
extern struct e820map e820; extern struct e820map e820;

View File

@ -79,7 +79,7 @@
#define KVM_NUM_MMU_PAGES (1 << KVM_MMU_HASH_SHIFT) #define KVM_NUM_MMU_PAGES (1 << KVM_MMU_HASH_SHIFT)
#define KVM_MIN_FREE_MMU_PAGES 5 #define KVM_MIN_FREE_MMU_PAGES 5
#define KVM_REFILL_PAGES 25 #define KVM_REFILL_PAGES 25
#define KVM_MAX_CPUID_ENTRIES 40 #define KVM_MAX_CPUID_ENTRIES 80
#define KVM_NR_FIXED_MTRR_REGION 88 #define KVM_NR_FIXED_MTRR_REGION 88
#define KVM_NR_VAR_MTRR 8 #define KVM_NR_VAR_MTRR 8

View File

@ -45,6 +45,7 @@ obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o
obj-y += tsc.o io_delay.o rtc.o obj-y += tsc.o io_delay.o rtc.o
obj-y += pci-iommu_table.o obj-y += pci-iommu_table.o
obj-y += resource.o
obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
obj-y += process.o obj-y += process.o

View File

@ -1383,6 +1383,14 @@ void __cpuinit end_local_APIC_setup(void)
#endif #endif
apic_pm_activate(); apic_pm_activate();
/*
* Now that local APIC setup is completed for BP, configure the fault
* handling for interrupt remapping.
*/
if (!smp_processor_id() && intr_remapping_enabled)
enable_drhd_fault_handling();
} }
#ifdef CONFIG_X86_X2APIC #ifdef CONFIG_X86_X2APIC

View File

@ -2429,13 +2429,12 @@ static void ack_apic_level(struct irq_data *data)
{ {
struct irq_cfg *cfg = data->chip_data; struct irq_cfg *cfg = data->chip_data;
int i, do_unmask_irq = 0, irq = data->irq; int i, do_unmask_irq = 0, irq = data->irq;
struct irq_desc *desc = irq_to_desc(irq);
unsigned long v; unsigned long v;
irq_complete_move(cfg); irq_complete_move(cfg);
#ifdef CONFIG_GENERIC_PENDING_IRQ #ifdef CONFIG_GENERIC_PENDING_IRQ
/* If we are moving the irq we need to mask it */ /* If we are moving the irq we need to mask it */
if (unlikely(desc->status & IRQ_MOVE_PENDING)) { if (unlikely(irq_to_desc(irq)->status & IRQ_MOVE_PENDING)) {
do_unmask_irq = 1; do_unmask_irq = 1;
mask_ioapic(cfg); mask_ioapic(cfg);
} }
@ -3367,6 +3366,7 @@ dmar_msi_set_affinity(struct irq_data *data, const struct cpumask *mask,
msg.data |= MSI_DATA_VECTOR(cfg->vector); msg.data |= MSI_DATA_VECTOR(cfg->vector);
msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
msg.address_lo |= MSI_ADDR_DEST_ID(dest); msg.address_lo |= MSI_ADDR_DEST_ID(dest);
msg.address_hi = MSI_ADDR_BASE_HI | MSI_ADDR_EXT_DEST_ID(dest);
dmar_msi_write(irq, &msg); dmar_msi_write(irq, &msg);

View File

@ -79,13 +79,6 @@ void __init default_setup_apic_routing(void)
/* need to update phys_pkg_id */ /* need to update phys_pkg_id */
apic->phys_pkg_id = apicid_phys_pkg_id; apic->phys_pkg_id = apicid_phys_pkg_id;
} }
/*
* Now that apic routing model is selected, configure the
* fault handling for intr remapping.
*/
if (intr_remapping_enabled)
enable_drhd_fault_handling();
} }
/* Same for both flat and physical. */ /* Same for both flat and physical. */

View File

@ -60,16 +60,18 @@
#define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD) #define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
#endif #endif
/* Number of possible pages in the lowmem region */
LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT)
/* Enough space to fit pagetables for the low memory linear map */ /* Enough space to fit pagetables for the low memory linear map */
MAPPING_BEYOND_END = \ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
PAGE_TABLE_SIZE(((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) << PAGE_SHIFT
/* /*
* Worst-case size of the kernel mapping we need to make: * Worst-case size of the kernel mapping we need to make:
* the worst-case size of the kernel itself, plus the extra we need * a relocatable kernel can live anywhere in lowmem, so we need to be able
* to map for the linear map. * to map all of lowmem.
*/ */
KERNEL_PAGES = (KERNEL_IMAGE_SIZE + MAPPING_BEYOND_END)>>PAGE_SHIFT KERNEL_PAGES = LOWMEM_PAGES
INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
RESERVE_BRK(pagetables, INIT_MAP_SIZE) RESERVE_BRK(pagetables, INIT_MAP_SIZE)
@ -620,13 +622,13 @@ ENTRY(initial_code)
__PAGE_ALIGNED_BSS __PAGE_ALIGNED_BSS
.align PAGE_SIZE_asm .align PAGE_SIZE_asm
#ifdef CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
initial_pg_pmd: ENTRY(initial_pg_pmd)
.fill 1024*KPMDS,4,0 .fill 1024*KPMDS,4,0
#else #else
ENTRY(initial_page_table) ENTRY(initial_page_table)
.fill 1024,4,0 .fill 1024,4,0
#endif #endif
initial_pg_fixmap: ENTRY(initial_pg_fixmap)
.fill 1024,4,0 .fill 1024,4,0
ENTRY(empty_zero_page) ENTRY(empty_zero_page)
.fill 4096,1,0 .fill 4096,1,0

View File

@ -27,6 +27,9 @@
#define HPET_DEV_FSB_CAP 0x1000 #define HPET_DEV_FSB_CAP 0x1000
#define HPET_DEV_PERI_CAP 0x2000 #define HPET_DEV_PERI_CAP 0x2000
#define HPET_MIN_CYCLES 128
#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
#define EVT_TO_HPET_DEV(evt) container_of(evt, struct hpet_dev, evt) #define EVT_TO_HPET_DEV(evt) container_of(evt, struct hpet_dev, evt)
/* /*
@ -299,8 +302,9 @@ static void hpet_legacy_clockevent_register(void)
/* Calculate the min / max delta */ /* Calculate the min / max delta */
hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF, hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
&hpet_clockevent); &hpet_clockevent);
/* 5 usec minimum reprogramming delta. */ /* Setup minimum reprogramming delta. */
hpet_clockevent.min_delta_ns = 5000; hpet_clockevent.min_delta_ns = clockevent_delta2ns(HPET_MIN_PROG_DELTA,
&hpet_clockevent);
/* /*
* Start hpet with the boot cpu mask and make it * Start hpet with the boot cpu mask and make it
@ -393,22 +397,24 @@ static int hpet_next_event(unsigned long delta,
* the wraparound into account) nor a simple count down event * the wraparound into account) nor a simple count down event
* mode. Further the write to the comparator register is * mode. Further the write to the comparator register is
* delayed internally up to two HPET clock cycles in certain * delayed internally up to two HPET clock cycles in certain
* chipsets (ATI, ICH9,10). We worked around that by reading * chipsets (ATI, ICH9,10). Some newer AMD chipsets have even
* back the compare register, but that required another * longer delays. We worked around that by reading back the
* workaround for ICH9,10 chips where the first readout after * compare register, but that required another workaround for
* write can return the old stale value. We already have a * ICH9,10 chips where the first readout after write can
* minimum delta of 5us enforced, but a NMI or SMI hitting * return the old stale value. We already had a minimum
* programming delta of 5us enforced, but a NMI or SMI hitting
* between the counter readout and the comparator write can * between the counter readout and the comparator write can
* move us behind that point easily. Now instead of reading * move us behind that point easily. Now instead of reading
* the compare register back several times, we make the ETIME * the compare register back several times, we make the ETIME
* decision based on the following: Return ETIME if the * decision based on the following: Return ETIME if the
* counter value after the write is less than 8 HPET cycles * counter value after the write is less than HPET_MIN_CYCLES
* away from the event or if the counter is already ahead of * away from the event or if the counter is already ahead of
* the event. * the event. The minimum programming delta for the generic
* clockevents code is set to 1.5 * HPET_MIN_CYCLES.
*/ */
res = (s32)(cnt - hpet_readl(HPET_COUNTER)); res = (s32)(cnt - hpet_readl(HPET_COUNTER));
return res < 8 ? -ETIME : 0; return res < HPET_MIN_CYCLES ? -ETIME : 0;
} }
static void hpet_legacy_set_mode(enum clock_event_mode mode, static void hpet_legacy_set_mode(enum clock_event_mode mode,

View File

@ -0,0 +1,48 @@
#include <linux/ioport.h>
#include <asm/e820.h>
static void resource_clip(struct resource *res, resource_size_t start,
resource_size_t end)
{
resource_size_t low = 0, high = 0;
if (res->end < start || res->start > end)
return; /* no conflict */
if (res->start < start)
low = start - res->start;
if (res->end > end)
high = res->end - end;
/* Keep the area above or below the conflict, whichever is larger */
if (low > high)
res->end = start - 1;
else
res->start = end + 1;
}
static void remove_e820_regions(struct resource *avail)
{
int i;
struct e820entry *entry;
for (i = 0; i < e820.nr_map; i++) {
entry = &e820.map[i];
resource_clip(avail, entry->addr,
entry->addr + entry->size - 1);
}
}
void arch_remove_reservations(struct resource *avail)
{
/* Trim out BIOS areas (low 1MB and high 2MB) and E820 regions */
if (avail->flags & IORESOURCE_MEM) {
if (avail->start < BIOS_END)
avail->start = BIOS_END;
resource_clip(avail, BIOS_ROM_BASE, BIOS_ROM_END);
remove_e820_regions(avail);
}
}

View File

@ -769,7 +769,6 @@ void __init setup_arch(char **cmdline_p)
x86_init.oem.arch_setup(); x86_init.oem.arch_setup();
resource_alloc_from_bottom = 0;
iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1; iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
setup_memory_map(); setup_memory_map();
parse_setup_data(); parse_setup_data();

View File

@ -394,7 +394,8 @@ static void __init setup_xstate_init(void)
* Setup init_xstate_buf to represent the init state of * Setup init_xstate_buf to represent the init state of
* all the features managed by the xsave * all the features managed by the xsave
*/ */
init_xstate_buf = alloc_bootmem(xstate_size); init_xstate_buf = alloc_bootmem_align(xstate_size,
__alignof__(struct xsave_struct));
init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT; init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT;
clts(); clts();

View File

@ -3494,6 +3494,10 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu)
static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
{ {
switch (func) { switch (func) {
case 0x00000001:
/* Mask out xsave bit as long as it is not supported by SVM */
entry->ecx &= ~(bit(X86_FEATURE_XSAVE));
break;
case 0x80000001: case 0x80000001:
if (nested) if (nested)
entry->ecx |= (1 << 2); /* Set SVM bit */ entry->ecx |= (1 << 2); /* Set SVM bit */

View File

@ -4227,11 +4227,6 @@ static int vmx_get_lpage_level(void)
return PT_PDPE_LEVEL; return PT_PDPE_LEVEL;
} }
static inline u32 bit(int bitno)
{
return 1 << (bitno & 31);
}
static void vmx_cpuid_update(struct kvm_vcpu *vcpu) static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
{ {
struct kvm_cpuid_entry2 *best; struct kvm_cpuid_entry2 *best;

Some files were not shown because too many files have changed in this diff Show More