Commit 3fb561b1 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mips_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS updates from Thomas Bogendoerfer:

 - add support for more BCM47XX based devices

 - add MIPS support for brcmstb PCIe controller

 - add Loongson 2K1000 reset driver

 - remove board support for rbtx4938/rbtx4939

 - remove support for TX4939 SoCs

 - fixes and cleanups

* tag 'mips_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (59 commits)
  MIPS: ath79: drop _machine_restart again
  PCI: brcmstb: Augment driver for MIPs SOCs
  MIPS: bmips: Remove obsolete DMA mapping support
  MIPS: bmips: Add support PCIe controller device nodes
  dt-bindings: PCI: Add compatible string for Brcmstb 74[23]5 MIPs SOCs
  MIPS: compressed: Fix build with ZSTD compression
  MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2
  MIPS: BCM47XX: Add support for Netgear R6300 v1
  MIPS: BCM47XX: Add LEDs and buttons for Asus RTN-10U
  MIPS: BCM47XX: Add board entry for Linksys WRT320N v1
  MIPS: BCM47XX: Define Linksys WRT310N V2 buttons
  MIPS: Remove duplicated include in local.h
  MIPS: retire "asm/llsc.h"
  MIPS: rework local_t operation on MIPS64
  MIPS: fix local_{add,sub}_return on MIPS64
  mips/pci: remove redundant ret variable
  MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init()
  MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS
  MIPS: enable both vmlinux.gz.itb and vmlinuz for generic
  MIPS: signal: Return immediately if call fails
  ...
parents 3ceff4ea d3115128
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/mips/loongson/ls2k-reset.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Loongson 2K1000 PM Controller
maintainers:
- Qing Zhang <zhangqing@loongson.cn>
description: |
This controller can be found in Loongson-2K1000 Soc systems.
properties:
compatible:
const: loongson,ls2k-pm
reg:
maxItems: 1
required:
- compatible
- reg
additionalProperties: false
examples:
- |
bus {
#address-cells = <2>;
#size-cells = <2>;
pm: reset-controller@1fe07000 {
compatible = "loongson,ls2k-pm";
reg = <0 0x1fe07000 0 0x422>;
};
};
...
...@@ -19,6 +19,8 @@ properties: ...@@ -19,6 +19,8 @@ properties:
- brcm,bcm7278-pcie # Broadcom 7278 Arm - brcm,bcm7278-pcie # Broadcom 7278 Arm
- brcm,bcm7216-pcie # Broadcom 7216 Arm - brcm,bcm7216-pcie # Broadcom 7216 Arm
- brcm,bcm7445-pcie # Broadcom 7445 Arm - brcm,bcm7445-pcie # Broadcom 7445 Arm
- brcm,bcm7425-pcie # Broadcom 7425 MIPs
- brcm,bcm7435-pcie # Broadcom 7435 MIPs
reg: reg:
maxItems: 1 maxItems: 1
......
...@@ -264,7 +264,6 @@ config BMIPS_GENERIC ...@@ -264,7 +264,6 @@ config BMIPS_GENERIC
bool "Broadcom Generic BMIPS kernel" bool "Broadcom Generic BMIPS kernel"
select ARCH_HAS_RESET_CONTROLLER select ARCH_HAS_RESET_CONTROLLER
select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
select ARCH_HAS_PHYS_TO_DMA
select BOOT_RAW select BOOT_RAW
select NO_EXCEPT_FILL select NO_EXCEPT_FILL
select USE_OF select USE_OF
...@@ -640,9 +639,6 @@ config MACH_REALTEK_RTL ...@@ -640,9 +639,6 @@ config MACH_REALTEK_RTL
select SYS_SUPPORTS_MIPS16 select SYS_SUPPORTS_MIPS16
select SYS_SUPPORTS_MULTITHREADING select SYS_SUPPORTS_MULTITHREADING
select SYS_SUPPORTS_VPE_LOADER select SYS_SUPPORTS_VPE_LOADER
select SYS_HAS_EARLY_PRINTK
select SYS_HAS_EARLY_PRINTK_8250
select USE_GENERIC_EARLY_PRINTK_8250
select BOOT_RAW select BOOT_RAW
select PINCTRL select PINCTRL
select USE_OF select USE_OF
...@@ -765,7 +761,6 @@ config SGI_IP30 ...@@ -765,7 +761,6 @@ config SGI_IP30
select HAVE_PCI select HAVE_PCI
select IRQ_MIPS_CPU select IRQ_MIPS_CPU
select IRQ_DOMAIN_HIERARCHY select IRQ_DOMAIN_HIERARCHY
select NR_CPUS_DEFAULT_2
select PCI_DRIVERS_GENERIC select PCI_DRIVERS_GENERIC
select PCI_XTALK_BRIDGE select PCI_XTALK_BRIDGE
select SYS_HAS_EARLY_PRINTK select SYS_HAS_EARLY_PRINTK
...@@ -1611,7 +1606,6 @@ config CPU_R4300 ...@@ -1611,7 +1606,6 @@ config CPU_R4300
depends on SYS_HAS_CPU_R4300 depends on SYS_HAS_CPU_R4300
select CPU_SUPPORTS_32BIT_KERNEL select CPU_SUPPORTS_32BIT_KERNEL
select CPU_SUPPORTS_64BIT_KERNEL select CPU_SUPPORTS_64BIT_KERNEL
select CPU_HAS_LOAD_STORE_LR
help help
MIPS Technologies R4300-series processors. MIPS Technologies R4300-series processors.
...@@ -1907,6 +1901,10 @@ config SYS_HAS_CPU_MIPS64_R1 ...@@ -1907,6 +1901,10 @@ config SYS_HAS_CPU_MIPS64_R1
config SYS_HAS_CPU_MIPS64_R2 config SYS_HAS_CPU_MIPS64_R2
bool bool
config SYS_HAS_CPU_MIPS64_R5
bool
select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT
config SYS_HAS_CPU_MIPS64_R6 config SYS_HAS_CPU_MIPS64_R6
bool bool
select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT
...@@ -2065,7 +2063,7 @@ config CPU_SUPPORTS_ADDRWINCFG ...@@ -2065,7 +2063,7 @@ config CPU_SUPPORTS_ADDRWINCFG
bool bool
config CPU_SUPPORTS_HUGEPAGES config CPU_SUPPORTS_HUGEPAGES
bool bool
depends on !(32BIT && (ARCH_PHYS_ADDR_T_64BIT || EVA)) depends on !(32BIT && (PHYS_ADDR_T_64BIT || EVA))
config MIPS_PGD_C0_CONTEXT config MIPS_PGD_C0_CONTEXT
bool bool
depends on 64BIT depends on 64BIT
...@@ -2116,6 +2114,16 @@ config MIPS_VA_BITS_48 ...@@ -2116,6 +2114,16 @@ config MIPS_VA_BITS_48
If unsure, say N. If unsure, say N.
config ZBOOT_LOAD_ADDRESS
hex "Compressed kernel load address"
default 0xffffffff80400000 if BCM47XX
default 0x0
depends on SYS_SUPPORTS_ZBOOT
help
The address to load compressed kernel, aka vmlinuz.
This is only used if non-zero.
choice choice
prompt "Kernel page size" prompt "Kernel page size"
default PAGE_SIZE_4KB default PAGE_SIZE_4KB
......
...@@ -253,9 +253,7 @@ endif ...@@ -253,9 +253,7 @@ endif
# #
# Board-dependent options and extra files # Board-dependent options and extra files
# #
ifdef need-compiler
include $(srctree)/arch/mips/Kbuild.platforms include $(srctree)/arch/mips/Kbuild.platforms
endif
ifdef CONFIG_PHYSICAL_START ifdef CONFIG_PHYSICAL_START
load-y = $(CONFIG_PHYSICAL_START) load-y = $(CONFIG_PHYSICAL_START)
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
* 675 Mass Ave, Cambridge, MA 02139, USA. * 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* Notes : * Notes :
* This file must ONLY be built when CONFIG_GPIOLIB=y and
* CONFIG_ALCHEMY_GPIO_INDIRECT=n, otherwise compilation will fail!
* au1000 SoC have only one GPIO block : GPIO1 * au1000 SoC have only one GPIO block : GPIO1
* Au1100, Au15x0, Au12x0 have a second one : GPIO2 * Au1100, Au15x0, Au12x0 have a second one : GPIO2
* Au1300 is totally different: 1 block with up to 128 GPIOs * Au1300 is totally different: 1 block with up to 128 GPIOs
......
...@@ -34,15 +34,6 @@ ...@@ -34,15 +34,6 @@
static char ath79_sys_type[ATH79_SYS_TYPE_LEN]; static char ath79_sys_type[ATH79_SYS_TYPE_LEN];
static void ath79_restart(char *command)
{
local_irq_disable();
ath79_device_reset_set(AR71XX_RESET_FULL_CHIP);
for (;;)
if (cpu_wait)
cpu_wait();
}
static void ath79_halt(void) static void ath79_halt(void)
{ {
while (1) while (1)
...@@ -234,7 +225,6 @@ void __init plat_mem_setup(void) ...@@ -234,7 +225,6 @@ void __init plat_mem_setup(void)
detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX); detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
_machine_restart = ath79_restart;
_machine_halt = ath79_halt; _machine_halt = ath79_halt;
pm_power_off = ath79_halt; pm_power_off = ath79_halt;
} }
......
...@@ -4,4 +4,3 @@ ...@@ -4,4 +4,3 @@
cflags-$(CONFIG_BCM47XX) += \ cflags-$(CONFIG_BCM47XX) += \
-I$(srctree)/arch/mips/include/asm/mach-bcm47xx -I$(srctree)/arch/mips/include/asm/mach-bcm47xx
load-$(CONFIG_BCM47XX) := 0xffffffff80001000 load-$(CONFIG_BCM47XX) := 0xffffffff80001000
zload-$(CONFIG_BCM47XX) += 0xffffffff80400000
...@@ -141,6 +141,7 @@ struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = { ...@@ -141,6 +141,7 @@ struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = {
{{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"}, {{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"},
{{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"}, {{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"},
{{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"}, {{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"},
{{BCM47XX_BOARD_LINKSYS_WRT320N_V1, "Linksys WRT320N V1"}, "WRT320N", "1.0"},
{{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"}, {{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"},
{{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"}, {{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"},
{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"}, {{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
...@@ -161,9 +162,12 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = { ...@@ -161,9 +162,12 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {
{{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"}, {{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
{{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"}, {{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
{{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_R6300_V1, "Netgear R6300 V1"}, "U12H218T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WN2500RP_V1, "Netgear WN2500RP V1"}, "U12H197T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WN2500RP_V2, "Netgear WN2500RP V2"}, "U12H294T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"},
{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"}, {{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
...@@ -345,7 +349,7 @@ void __init bcm47xx_board_detect(void) ...@@ -345,7 +349,7 @@ void __init bcm47xx_board_detect(void)
board_detected = bcm47xx_board_get_nvram(); board_detected = bcm47xx_board_get_nvram();
bcm47xx_board.board = board_detected->board; bcm47xx_board.board = board_detected->board;
strlcpy(bcm47xx_board.name, board_detected->name, strscpy(bcm47xx_board.name, board_detected->name,
BCM47XX_BOARD_MAX_NAME); BCM47XX_BOARD_MAX_NAME);
} }
......
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
/* Asus */ /* Asus */
static const struct gpio_keys_button
bcm47xx_buttons_asus_rtn10u[] __initconst = {
BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
BCM47XX_GPIO_KEY(21, KEY_RESTART),
};
static const struct gpio_keys_button static const struct gpio_keys_button
bcm47xx_buttons_asus_rtn12[] __initconst = { bcm47xx_buttons_asus_rtn12[] __initconst = {
BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
...@@ -276,6 +282,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __initconst = { ...@@ -276,6 +282,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __initconst = {
BCM47XX_GPIO_KEY(8, KEY_UNKNOWN), BCM47XX_GPIO_KEY(8, KEY_UNKNOWN),
}; };
static const struct gpio_keys_button
bcm47xx_buttons_linksys_wrt310n_v2[] __initconst = {
BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
BCM47XX_GPIO_KEY(6, KEY_RESTART),
};
static const struct gpio_keys_button
bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = {
BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
BCM47XX_GPIO_KEY(8, KEY_RESTART),
};
static const struct gpio_keys_button static const struct gpio_keys_button
bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = { bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
BCM47XX_GPIO_KEY(5, KEY_WIMAX), BCM47XX_GPIO_KEY(5, KEY_WIMAX),
...@@ -391,6 +409,17 @@ bcm47xx_buttons_netgear_r6200_v1[] __initconst = { ...@@ -391,6 +409,17 @@ bcm47xx_buttons_netgear_r6200_v1[] __initconst = {
BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
}; };
static const struct gpio_keys_button
bcm47xx_buttons_netgear_r6300_v1[] __initconst = {
BCM47XX_GPIO_KEY(6, KEY_RESTART),
};
static const struct gpio_keys_button
bcm47xx_buttons_netgear_wn2500rp_v1[] __initconst = {
BCM47XX_GPIO_KEY(12, KEY_RESTART),
BCM47XX_GPIO_KEY(31, KEY_WPS_BUTTON),
};
static const struct gpio_keys_button static const struct gpio_keys_button
bcm47xx_buttons_netgear_wndr3400v1[] __initconst = { bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
BCM47XX_GPIO_KEY(4, KEY_RESTART), BCM47XX_GPIO_KEY(4, KEY_RESTART),
...@@ -478,6 +507,9 @@ int __init bcm47xx_buttons_register(void) ...@@ -478,6 +507,9 @@ int __init bcm47xx_buttons_register(void)
int err; int err;
switch (board) { switch (board) {
case BCM47XX_BOARD_ASUS_RTN10U:
err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u);
break;
case BCM47XX_BOARD_ASUS_RTN12: case BCM47XX_BOARD_ASUS_RTN12:
err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12); err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
break; break;
...@@ -608,6 +640,12 @@ int __init bcm47xx_buttons_register(void) ...@@ -608,6 +640,12 @@ int __init bcm47xx_buttons_register(void)
case BCM47XX_BOARD_LINKSYS_WRT310NV1: case BCM47XX_BOARD_LINKSYS_WRT310NV1:
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
break; break;
case BCM47XX_BOARD_LINKSYS_WRT310NV2:
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
break;
case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
break;
case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2); err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
break; break;
...@@ -674,6 +712,12 @@ int __init bcm47xx_buttons_register(void) ...@@ -674,6 +712,12 @@ int __init bcm47xx_buttons_register(void)
case BCM47XX_BOARD_NETGEAR_R6200_V1: case BCM47XX_BOARD_NETGEAR_R6200_V1:
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1); err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
break; break;
case BCM47XX_BOARD_NETGEAR_R6300_V1:
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
break;
case BCM47XX_BOARD_NETGEAR_WN2500RP_V1:
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wn2500rp_v1);
break;
case BCM47XX_BOARD_NETGEAR_WNDR3400V1: case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1); err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
break; break;
......
...@@ -29,6 +29,14 @@ ...@@ -29,6 +29,14 @@
/* Asus */ /* Asus */
static const struct gpio_led
bcm47xx_leds_asus_rtn10u[] __initconst = {
BCM47XX_GPIO_LED(5, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(6, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
BCM47XX_GPIO_LED(7, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(8, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
};
static const struct gpio_led static const struct gpio_led
bcm47xx_leds_asus_rtn12[] __initconst = { bcm47xx_leds_asus_rtn12[] __initconst = {
BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
...@@ -313,6 +321,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initconst = { ...@@ -313,6 +321,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initconst = {
BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
}; };
static const struct gpio_led
bcm47xx_leds_linksys_wrt320n_v1[] __initconst = {
BCM47XX_GPIO_LED(1, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
};
static const struct gpio_led static const struct gpio_led
bcm47xx_leds_linksys_wrt54g_generic[] __initconst = { bcm47xx_leds_linksys_wrt54g_generic[] __initconst = {
BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
...@@ -556,6 +571,9 @@ void __init bcm47xx_leds_register(void) ...@@ -556,6 +571,9 @@ void __init bcm47xx_leds_register(void)
enum bcm47xx_board board = bcm47xx_board_get(); enum bcm47xx_board board = bcm47xx_board_get();
switch (board) { switch (board) {
case BCM47XX_BOARD_ASUS_RTN10U:
bcm47xx_set_pdata(bcm47xx_leds_asus_rtn10u);
break;
case BCM47XX_BOARD_ASUS_RTN12: case BCM47XX_BOARD_ASUS_RTN12:
bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12); bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
break; break;
...@@ -689,6 +707,9 @@ void __init bcm47xx_leds_register(void) ...@@ -689,6 +707,9 @@ void __init bcm47xx_leds_register(void)
case BCM47XX_BOARD_LINKSYS_WRT310NV1: case BCM47XX_BOARD_LINKSYS_WRT310NV1:
bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1); bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
break; break;
case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt320n_v1);
break;
case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2); bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
break; break;
......
...@@ -387,6 +387,12 @@ struct clk *clk_get_parent(struct clk *clk) ...@@ -387,6 +387,12 @@ struct clk *clk_get_parent(struct clk *clk)
} }
EXPORT_SYMBOL(clk_get_parent); EXPORT_SYMBOL(clk_get_parent);
int clk_set_parent(struct clk *clk, struct clk *parent)
{
return 0;
}
EXPORT_SYMBOL(clk_set_parent);
unsigned long clk_get_rate(struct clk *clk) unsigned long clk_get_rate(struct clk *clk)
{ {
if (!clk) if (!clk)
......
/* // SPDX-License-Identifier: GPL-2.0+
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2014 Kevin Cernekee <cernekee@gmail.com>
*/
#define pr_fmt(fmt) "bmips-dma: " fmt
#include <linux/device.h>
#include <linux/dma-direction.h>
#include <linux/dma-direct.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/bmips.h> #include <asm/bmips.h>
#include <asm/io.h>
/*
* BCM338x has configurable address translation windows which allow the
* peripherals' DMA addresses to be different from the Zephyr-visible
* physical addresses. e.g. usb_dma_addr = zephyr_pa ^ 0x08000000
*
* If the "brcm,ubus" node has a "dma-ranges" property we will enable this
* translation globally using the provided information. This implements a
* very limited subset of "dma-ranges" support and it will probably be
* replaced by a more generic version later.
*/
struct bmips_dma_range {
u32 child_addr;
u32 parent_addr;
u32 size;
};
static struct bmips_dma_range *bmips_dma_ranges;
#define FLUSH_RAC 0x100
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t pa)
{
struct bmips_dma_range *r;
for (r = bmips_dma_ranges; r && r->size; r++) {
if (pa >= r->child_addr &&
pa < (r->child_addr + r->size))
return pa - r->child_addr + r->parent_addr;
}
return pa;
}
phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dma_addr)
{
struct bmips_dma_range *r;
for (r = bmips_dma_ranges; r && r->size; r++) {
if (dma_addr >= r->parent_addr &&
dma_addr < (r->parent_addr + r->size))
return dma_addr - r->parent_addr + r->child_addr;
}
return dma_addr;
}
void arch_sync_dma_for_cpu_all(void) void arch_sync_dma_for_cpu_all(void)
{ {
...@@ -79,45 +19,3 @@ void arch_sync_dma_for_cpu_all(void) ...@@ -79,45 +19,3 @@ void arch_sync_dma_for_cpu_all(void)
__raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG); __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
__raw_readl(cbr + BMIPS_RAC_CONFIG); __raw_readl(cbr + BMIPS_RAC_CONFIG);
} }
static int __init bmips_init_dma_ranges(void)
{
struct device_node *np =
of_find_compatible_node(NULL, NULL, "brcm,ubus");
const __be32 *data;
struct bmips_dma_range *r;
int len;
if (!np)
return 0;
data = of_get_property(np, "dma-ranges", &len);
if (!data)
goto out_good;
len /= sizeof(*data) * 3;
if (!len)
goto out_bad;
/* add a dummy (zero) entry at the end as a sentinel */
bmips_dma_ranges = kcalloc(len + 1, sizeof(struct bmips_dma_range),
GFP_KERNEL);
if (!bmips_dma_ranges)
goto out_bad;
for (r = bmips_dma_ranges; len; len--, r++) {
r->child_addr = be32_to_cpup(data++);
r->parent_addr = be32_to_cpup(data++);
r->size = be32_to_cpup(data++);
}
out_good:
of_node_put(np);
return 0;
out_bad:
pr_err("error parsing dma-ranges property\n");
of_node_put(np);
return -EINVAL;
}
arch_initcall(bmips_init_dma_ranges);
...@@ -52,7 +52,7 @@ endif ...@@ -52,7 +52,7 @@ endif
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o $(obj)/ashldi3.o vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o $(obj)/ashldi3.o $(obj)/clz_ctz.o
targets := $(notdir $(vmlinuzobjs-y)) targets := $(notdir $(vmlinuzobjs-y))
...@@ -89,6 +89,10 @@ HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE) ...@@ -89,6 +89,10 @@ HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
# Calculate the load address of the compressed kernel image # Calculate the load address of the compressed kernel image
hostprogs := calc_vmlinuz_load_addr hostprogs := calc_vmlinuz_load_addr
ifneq (0x0,$(CONFIG_ZBOOT_LOAD_ADDRESS))
zload-y = $(CONFIG_ZBOOT_LOAD_ADDRESS)
endif
ifneq ($(zload-y),) ifneq ($(zload-y),)
VMLINUZ_LOAD_ADDRESS := $(zload-y) VMLINUZ_LOAD_ADDRESS := $(zload-y)
else else
......
// SPDX-License-Identifier: GPL-2.0-only
#include "../../../../lib/clz_ctz.c"
...@@ -584,4 +584,34 @@ shimphy@8000 { ...@@ -584,4 +584,34 @@ shimphy@8000 {
}; };
}; };
}; };
pcie_0: pcie@8b20000 {
status = "disabled";
compatible = "brcm,bcm7425-pcie";
ranges = <0x02000000 0x0 0xd0000000 0xd0000000 0x0 0x08000000
0x02000000 0x0 0xd8000000 0xd8000000 0x0 0x08000000
0x02000000 0x0 0xe0000000 0xe0000000 0x0 0x08000000
0x02000000 0x0 0xe8000000 0xe8000000 0x0 0x08000000>;
reg = <0x10410000 0x19310>;
aspm-no-l0s;
device_type = "pci";
msi-controller;
msi-parent = <&pcie_0>;
#address-cells = <0x3>;
#size-cells = <0x2>;
bus-range = <0x0 0xff>;
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
linux,pci-domain = <0x0>;
interrupt-parent = <&periph_intc>;
interrupts = <37>, <37>;
interrupt-names = "pcie", "msi";
#interrupt-cells = <0x1>;
interrupt-map = <0 0 0 1 &periph_intc 0x21
0 0 0 1 &periph_intc 0x22
0 0 0 1 &periph_intc 0x23
0 0 0 1 &periph_intc 0x24>;
};
}; };
...@@ -599,4 +599,34 @@ shimphy@8000 { ...@@ -599,4 +599,34 @@ shimphy@8000 {
}; };
}; };
}; };
pcie_0: pcie@8b20000 {
status = "disabled";
compatible = "brcm,bcm7435-pcie";
ranges = <0x02000000 0x0 0xd0000000 0xd0000000 0x0 0x08000000
0x02000000 0x0 0xd8000000 0xd8000000 0x0 0x08000000
0x02000000 0x0 0xe0000000 0xe0000000 0x0 0x08000000
0x02000000 0x0 0xe8000000 0xe8000000 0x0 0x08000000>;
reg = <0x10410000 0x19310>;
aspm-no-l0s;
device_type = "pci";
msi-controller;
msi-parent = <&pcie_0>;
#address-cells = <0x3>;
#size-cells = <0x2>;
bus-range = <0x0 0xff>;
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
linux,pci-domain = <0x0>;
interrupt-parent = <&periph_intc>;
interrupts = <39>, <39>;
interrupt-names = "pcie", "msi";
#interrupt-cells = <0x1>;
interrupt-map = <0 0 0 1 &periph_intc 0x23
0 0 0 1 &periph_intc 0x24
0 0 0 1 &periph_intc 0x25
0 0 0 1 &periph_intc 0x26>;
};
}; };
...@@ -152,3 +152,12 @@ &mspi { ...@@ -152,3 +152,12 @@ &mspi {
&waketimer { &waketimer {
status = "okay"; status = "okay";
}; };
&pcie_0 {
status = "okay";
/* 1GB Memc0, 1GB Memc1 */
brcm,scb-sizes = <0 0x40000000 0 0x40000000>;
dma-ranges = <0x43000000 0x00000000 0x00000000 0x00000000 0x0 0x10000000
0x43000000 0x00000000 0x10000000 0x20000000 0x0 0x30000000
0x43000000 0x00000000 0x40000000 0x90000000 0x0 0x40000000>;
};
...@@ -128,3 +128,12 @@ &mspi { ...@@ -128,3 +128,12 @@ &mspi {
&waketimer { &waketimer {
status = "okay"; status = "okay";
}; };
&pcie_0 {
status = "okay";
/* 1GB Memc0, 1GB Memc1 */
brcm,scb-sizes = <0 0x40000000 0 0x40000000>;
dma-ranges = <0x43000000 0x00000000 0x00000000 0x00000000 0x0 0x10000000
0x43000000 0x00000000 0x10000000 0x20000000 0x0 0x30000000
0x43000000 0x00000000 0x40000000 0x90000000 0x0 0x40000000>;
};
...@@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 { ...@@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 {
enable-active-high; enable-active-high;
}; };
hdmi_out: connector {
compatible = "hdmi-connector";
label = "HDMI OUT";
type = "a";
port {
hdmi_con: endpoint {
remote-endpoint = <&dw_hdmi_out>;
};
};
};
ir: ir { ir: ir {
compatible = "gpio-ir-receiver"; compatible = "gpio-ir-receiver";
gpios = <&gpe 3 GPIO_ACTIVE_LOW>; gpios = <&gpe 3 GPIO_ACTIVE_LOW>;
...@@ -102,6 +114,17 @@ otg_power: fixedregulator@2 { ...@@ -102,6 +114,17 @@ otg_power: fixedregulator@2 {
gpio = <&gpf 14 GPIO_ACTIVE_LOW>; gpio = <&gpf 14 GPIO_ACTIVE_LOW>;
enable-active-high; enable-active-high;
}; };
hdmi_power: fixedregulator@3 {
compatible = "regulator-fixed";
regulator-name = "hdmi_power";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpa 25 0>;
enable-active-high;
};
}; };
&ext { &ext {
...@@ -114,11 +137,12 @@ &cgu { ...@@ -114,11 +137,12 @@ &cgu {
* precision. * precision.
*/ */
assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>, assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>,
<&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>; <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>,
<&cgu JZ4780_CLK_HDMI>;
assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>,
<&cgu JZ4780_CLK_MPLL>, <&cgu JZ4780_CLK_MPLL>,
<&cgu JZ4780_CLK_SSIPLL>; <&cgu JZ4780_CLK_SSIPLL>;
assigned-clock-rates = <48000000>, <0>, <54000000>; assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>;
}; };
&tcu { &tcu {
...@@ -509,6 +533,12 @@ pins_i2c4: i2c4 { ...@@ -509,6 +533,12 @@ pins_i2c4: i2c4 {
bias-disable; bias-disable;
}; };
pins_hdmi_ddc: hdmi_ddc {
function = "hdmi-ddc";
groups = "hdmi-ddc";
bias-disable;
};
pins_nemc: nemc { pins_nemc: nemc {
function = "nemc"; function = "nemc";
groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe"; groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe";
...@@ -539,3 +569,41 @@ pins_mmc1: mmc1 { ...@@ -539,3 +569,41 @@ pins_mmc1: mmc1 {
bias-disable; bias-disable;
}; };
}; };
&hdmi {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pins_hdmi_ddc>;
hdmi-5v-supply = <&hdmi_power>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dw_hdmi_in: endpoint {
remote-endpoint = <&lcd_out>;
};
};
port@1 {
reg = <1>;
dw_hdmi_out: endpoint {
remote-endpoint = <&hdmi_con>;
};
};
};
};
&lcdc0 {
status = "okay";
port {
lcd_out: endpoint {
remote-endpoint = <&dw_hdmi_in>;
};
};
};
...@@ -321,7 +321,7 @@ udc: usb@13040000 { ...@@ -321,7 +321,7 @@ udc: usb@13040000 {
lcd: lcd-controller@13050000 { lcd: lcd-controller@13050000 {
compatible = "ingenic,jz4725b-lcd"; compatible = "ingenic,jz4725b-lcd";
reg = <0x13050000 0x1000>; reg = <0x13050000 0x130>; /* tbc */
interrupt-parent = <&intc>; interrupt-parent = <&intc>;
interrupts = <31>; interrupts = <31>;
......
...@@ -323,7 +323,7 @@ udc: usb@13040000 { ...@@ -323,7 +323,7 @@ udc: usb@13040000 {
lcd: lcd-controller@13050000 { lcd: lcd-controller@13050000 {
compatible = "ingenic,jz4740-lcd"; compatible = "ingenic,jz4740-lcd";
reg = <0x13050000 0x1000>; reg = <0x13050000 0x60>; /* LCDCMD1+4 */
interrupt-parent = <&intc>; interrupt-parent = <&intc>;
interrupts = <30>; interrupts = <30>;
......
...@@ -399,7 +399,7 @@ gpu: gpu@13040000 { ...@@ -399,7 +399,7 @@ gpu: gpu@13040000 {
lcd: lcd-controller@13050000 { lcd: lcd-controller@13050000 {
compatible = "ingenic,jz4770-lcd"; compatible = "ingenic,jz4770-lcd";
reg = <0x13050000 0x300>; reg = <0x13050000 0x130>; /* tbc */
interrupt-parent = <&intc>; interrupt-parent = <&intc>;
interrupts = <31>; interrupts = <31>;
......
...@@ -444,6 +444,46 @@ i2c4: i2c@10054000 { ...@@ -444,6 +444,46 @@ i2c4: i2c@10054000 {
status = "disabled"; status = "disabled";
}; };
hdmi: hdmi@10180000 {
compatible = "ingenic,jz4780-dw-hdmi";
reg = <0x10180000 0x8000>;
reg-io-width = <4>;
clocks = <&cgu JZ4780_CLK_AHB0>, <&cgu JZ4780_CLK_HDMI>;
clock-names = "iahb", "isfr";
interrupt-parent = <&intc>;
interrupts = <3>;
status = "disabled";
};
lcdc0: lcdc0@13050000 {
compatible = "ingenic,jz4780-lcd";
reg = <0x13050000 0x1800>;
clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD0PIXCLK>;
clock-names = "lcd", "lcd_pclk";
interrupt-parent = <&intc>;
interrupts = <31>;
status = "disabled";
};
lcdc1: lcdc1@130a0000 {
compatible = "ingenic,jz4780-lcd";
reg = <0x130a0000 0x1800>;
clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD1PIXCLK>;
clock-names = "lcd", "lcd_pclk";
interrupt-parent = <&intc>;
interrupts = <23>;
status = "disabled";
};
nemc: nemc@13410000 { nemc: nemc@13410000 {
compatible = "ingenic,jz4780-nemc", "simple-mfd"; compatible = "ingenic,jz4780-nemc", "simple-mfd";
reg = <0x13410000 0x10000>; reg = <0x13410000 0x10000>;
......
...@@ -52,6 +52,11 @@ package0: bus@10000000 { ...@@ -52,6 +52,11 @@ package0: bus@10000000 {
0 0x40000000 0 0x40000000 0 0x40000000 0 0x40000000 0 0x40000000 0 0x40000000
0xfe 0x00000000 0xfe 0x00000000 0 0x40000000>; 0xfe 0x00000000 0xfe 0x00000000 0 0x40000000>;
pm: reset-controller@1fe07000 {
compatible = "loongson,ls2k-pm";
reg = <0 0x1fe07000 0 0x422>;
};
liointc0: interrupt-controller@1fe11400 { liointc0: interrupt-controller@1fe11400 {
compatible = "loongson,liointc-2.0"; compatible = "loongson,liointc-2.0";
reg = <0 0x1fe11400 0 0x40>, reg = <0 0x1fe11400 0 0x40>,
......
...@@ -328,6 +328,7 @@ static int __init octeon_ehci_device_init(void) ...@@ -328,6 +328,7 @@ static int __init octeon_ehci_device_init(void)
pd->dev.platform_data = &octeon_ehci_pdata; pd->dev.platform_data = &octeon_ehci_pdata;
octeon_ehci_hw_start(&pd->dev); octeon_ehci_hw_start(&pd->dev);
put_device(&pd->dev);
return ret; return ret;
} }
...@@ -391,6 +392,7 @@ static int __init octeon_ohci_device_init(void) ...@@ -391,6 +392,7 @@ static int __init octeon_ohci_device_init(void)
pd->dev.platform_data = &octeon_ohci_pdata; pd->dev.platform_data = &octeon_ohci_pdata;
octeon_ohci_hw_start(&pd->dev); octeon_ohci_hw_start(&pd->dev);
put_device(&pd->dev);
return ret; return ret;
} }
......
...@@ -537,6 +537,7 @@ static int __init dwc3_octeon_device_init(void) ...@@ -537,6 +537,7 @@ static int __init dwc3_octeon_device_init(void)
devm_iounmap(&pdev->dev, base); devm_iounmap(&pdev->dev, base);
devm_release_mem_region(&pdev->dev, res->start, devm_release_mem_region(&pdev->dev, res->start,
resource_size(res)); resource_size(res));
put_device(&pdev->dev);
} }
} while (node != NULL); } while (node != NULL);
......
...@@ -98,7 +98,13 @@ CONFIG_RC_DEVICES=y ...@@ -98,7 +98,13 @@ CONFIG_RC_DEVICES=y
CONFIG_IR_GPIO_CIR=m CONFIG_IR_GPIO_CIR=m
CONFIG_IR_GPIO_TX=m CONFIG_IR_GPIO_TX=m
CONFIG_MEDIA_SUPPORT=m CONFIG_MEDIA_SUPPORT=m
CONFIG_DRM=m
CONFIG_DRM_INGENIC=m
CONFIG_DRM_INGENIC_DW_HDMI=m
CONFIG_DRM_DISPLAY_CONNECTOR=m
# CONFIG_VGA_CONSOLE is not set # CONFIG_VGA_CONSOLE is not set
CONFIG_FB=y
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_HID is not set # CONFIG_HID is not set
CONFIG_USB=y CONFIG_USB=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
......
...@@ -10,9 +10,6 @@ CONFIG_EXPERT=y ...@@ -10,9 +10,6 @@ CONFIG_EXPERT=y
CONFIG_SLAB=y CONFIG_SLAB=y
CONFIG_MACH_TX49XX=y CONFIG_MACH_TX49XX=y
CONFIG_TOSHIBA_RBTX4927=y CONFIG_TOSHIBA_RBTX4927=y
CONFIG_TOSHIBA_RBTX4938=y
CONFIG_TOSHIBA_RBTX4939=y
CONFIG_TOSHIBA_RBTX4938_MPLEX_KEEP=y
# CONFIG_SECCOMP is not set # CONFIG_SECCOMP is not set
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_MODULES=y CONFIG_MODULES=y
...@@ -38,7 +35,6 @@ CONFIG_MTD_JEDECPROBE=y ...@@ -38,7 +35,6 @@ CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_CFI_AMDSTD=y CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_COMPLEX_MAPPINGS=y CONFIG_MTD_COMPLEX_MAPPINGS=y
CONFIG_MTD_PHYSMAP=y CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_RBTX4939=y
CONFIG_MTD_RAW_NAND=m CONFIG_MTD_RAW_NAND=m
CONFIG_MTD_NAND_TXX9NDFMC=m CONFIG_MTD_NAND_TXX9NDFMC=m
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
......
...@@ -113,7 +113,7 @@ void __init prom_init(void) ...@@ -113,7 +113,7 @@ void __init prom_init(void)
if ((current_cpu_type() == CPU_R4000SC) || if ((current_cpu_type() == CPU_R4000SC) ||
(current_cpu_type() == CPU_R4400SC)) { (current_cpu_type() == CPU_R4400SC)) {
static const char r4k_msg[] __initconst = static const char r4k_msg[] __initconst =
"Please recompile with \"CONFIG_CPU_R4x00 = y\".\n"; "Please recompile with \"CONFIG_CPU_R4X00 = y\".\n";
printk(cpu_msg); printk(cpu_msg);
printk(r4k_msg); printk(r4k_msg);
dec_machine_halt(); dec_machine_halt();
......
...@@ -13,8 +13,7 @@ cflags-$(CONFIG_MACH_INGENIC_SOC) += -I$(srctree)/arch/mips/include/asm/mach-ing ...@@ -13,8 +13,7 @@ cflags-$(CONFIG_MACH_INGENIC_SOC) += -I$(srctree)/arch/mips/include/asm/mach-ing
cflags-$(CONFIG_MIPS_GENERIC) += -I$(srctree)/arch/mips/include/asm/mach-generic cflags-$(CONFIG_MIPS_GENERIC) += -I$(srctree)/arch/mips/include/asm/mach-generic
load-$(CONFIG_MIPS_GENERIC) += 0xffffffff80100000 load-$(CONFIG_MIPS_GENERIC) += 0xffffffff80100000
zload-$(CONFIG_MIPS_GENERIC) += 0xffffffff81000000 all-$(CONFIG_MIPS_GENERIC) += vmlinux.gz.itb
all-$(CONFIG_MIPS_GENERIC) := vmlinux.gz.itb
its-y := vmlinux.its.S its-y := vmlinux.its.S
its-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += board-boston.its.S its-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += board-boston.its.S
......
...@@ -110,14 +110,15 @@ void __init plat_mem_setup(void) ...@@ -110,14 +110,15 @@ void __init plat_mem_setup(void)
void __init device_tree_init(void) void __init device_tree_init(void)
{ {
int err;
unflatten_and_copy_device_tree(); unflatten_and_copy_device_tree();
mips_cpc_probe(); mips_cpc_probe();
err = register_cps_smp_ops(); if (!register_cps_smp_ops())
if (err) return;
err = register_up_smp_ops(); if (!register_vsmp_smp_ops())
return;
register_up_smp_ops();
} }
int __init apply_mips_fdt_fixups(void *fdt_out, size_t fdt_out_size, int __init apply_mips_fdt_fixups(void *fdt_out, size_t fdt_out_size,
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <asm/sgidefs.h> #include <asm/sgidefs.h>
#include <asm/asm-eva.h> #include <asm/asm-eva.h>
#include <asm/isa-rev.h>
#ifndef __VDSO__ #ifndef __VDSO__
/* /*
...@@ -211,6 +212,8 @@ symbol = value ...@@ -211,6 +212,8 @@ symbol = value
#define LONG_SUB sub #define LONG_SUB sub
#define LONG_SUBU subu #define LONG_SUBU subu
#define LONG_L lw #define LONG_L lw
#define LONG_LL ll
#define LONG_SC sc
#define LONG_S sw #define LONG_S sw
#define LONG_SP swp #define LONG_SP swp
#define LONG_SLL sll #define LONG_SLL sll
...@@ -219,6 +222,8 @@ symbol = value ...@@ -219,6 +222,8 @@ symbol = value
#define LONG_SRLV srlv #define LONG_SRLV srlv
#define LONG_SRA sra #define LONG_SRA sra
#define LONG_SRAV srav #define LONG_SRAV srav
#define LONG_INS ins
#define LONG_EXT ext
#ifdef __ASSEMBLY__ #ifdef __ASSEMBLY__
#define LONG .word #define LONG .word
...@@ -236,6 +241,8 @@ symbol = value ...@@ -236,6 +241,8 @@ symbol = value
#define LONG_SUB dsub #define LONG_SUB dsub
#define LONG_SUBU dsubu #define LONG_SUBU dsubu
#define LONG_L ld #define LONG_L ld
#define LONG_LL lld
#define LONG_SC scd
#define LONG_S sd #define LONG_S sd
#define LONG_SP sdp #define LONG_SP sdp
#define LONG_SLL dsll #define LONG_SLL dsll
...@@ -244,6 +251,8 @@ symbol = value ...@@ -244,6 +251,8 @@ symbol = value
#define LONG_SRLV dsrlv #define LONG_SRLV dsrlv
#define LONG_SRA dsra #define LONG_SRA dsra
#define LONG_SRAV dsrav #define LONG_SRAV dsrav
#define LONG_INS dins
#define LONG_EXT dext
#ifdef __ASSEMBLY__ #ifdef __ASSEMBLY__
#define LONG .dword #define LONG .dword
...@@ -320,6 +329,19 @@ symbol = value ...@@ -320,6 +329,19 @@ symbol = value
#define SSNOP sll zero, zero, 1 #define SSNOP sll zero, zero, 1
/*
* Using a branch-likely instruction to check the result of an sc instruction
* works around a bug present in R10000 CPUs prior to revision 3.0 that could
* cause ll-sc sequences to execute non-atomically.
*/
#ifdef CONFIG_WAR_R10000_LLSC
# define SC_BEQZ beqzl
#elif MIPS_ISA_REV >= 6
# define SC_BEQZ beqzc
#else
# define SC_BEQZ beqz
#endif
#ifdef CONFIG_SGI_IP28 #ifdef CONFIG_SGI_IP28
/* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */ /* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */
#include <asm/cacheops.h> #include <asm/cacheops.h>
......
...@@ -16,13 +16,12 @@ ...@@ -16,13 +16,12 @@
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/asm.h>
#include <asm/barrier.h> #include <asm/barrier.h>
#include <asm/compiler.h> #include <asm/compiler.h>
#include <asm/cpu-features.h> #include <asm/cpu-features.h>
#include <asm/cmpxchg.h> #include <asm/cmpxchg.h>
#include <asm/llsc.h>
#include <asm/sync.h> #include <asm/sync.h>
#include <asm/war.h>
#define ATOMIC_OPS(pfx, type) \ #define ATOMIC_OPS(pfx, type) \
static __always_inline type arch_##pfx##_read(const pfx##_t *v) \ static __always_inline type arch_##pfx##_read(const pfx##_t *v) \
...@@ -74,7 +73,7 @@ static __inline__ void arch_##pfx##_##op(type i, pfx##_t * v) \ ...@@ -74,7 +73,7 @@ static __inline__ void arch_##pfx##_##op(type i, pfx##_t * v) \
"1: " #ll " %0, %1 # " #pfx "_" #op " \n" \ "1: " #ll " %0, %1 # " #pfx "_" #op " \n" \
" " #asm_op " %0, %2 \n" \ " " #asm_op " %0, %2 \n" \
" " #sc " %0, %1 \n" \ " " #sc " %0, %1 \n" \
"\t" __SC_BEQZ "%0, 1b \n" \ "\t" __stringify(SC_BEQZ) " %0, 1b \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r" (temp), "+" GCC_OFF_SMALL_ASM() (v->counter) \ : "=&r" (temp), "+" GCC_OFF_SMALL_ASM() (v->counter) \
: "Ir" (i) : __LLSC_CLOBBER); \ : "Ir" (i) : __LLSC_CLOBBER); \
...@@ -104,7 +103,7 @@ arch_##pfx##_##op##_return_relaxed(type i, pfx##_t * v) \ ...@@ -104,7 +103,7 @@ arch_##pfx##_##op##_return_relaxed(type i, pfx##_t * v) \
"1: " #ll " %1, %2 # " #pfx "_" #op "_return\n" \ "1: " #ll " %1, %2 # " #pfx "_" #op "_return\n" \
" " #asm_op " %0, %1, %3 \n" \ " " #asm_op " %0, %1, %3 \n" \
" " #sc " %0, %2 \n" \ " " #sc " %0, %2 \n" \
"\t" __SC_BEQZ "%0, 1b \n" \ "\t" __stringify(SC_BEQZ) " %0, 1b \n" \
" " #asm_op " %0, %1, %3 \n" \ " " #asm_op " %0, %1, %3 \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r" (result), "=&r" (temp), \ : "=&r" (result), "=&r" (temp), \
...@@ -137,7 +136,7 @@ arch_##pfx##_fetch_##op##_relaxed(type i, pfx##_t * v) \ ...@@ -137,7 +136,7 @@ arch_##pfx##_fetch_##op##_relaxed(type i, pfx##_t * v) \
"1: " #ll " %1, %2 # " #pfx "_fetch_" #op "\n" \ "1: " #ll " %1, %2 # " #pfx "_fetch_" #op "\n" \
" " #asm_op " %0, %1, %3 \n" \ " " #asm_op " %0, %1, %3 \n" \
" " #sc " %0, %2 \n" \ " " #sc " %0, %2 \n" \
"\t" __SC_BEQZ "%0, 1b \n" \ "\t" __stringify(SC_BEQZ) " %0, 1b \n" \
" .set pop \n" \ " .set pop \n" \
" move %0, %1 \n" \ " move %0, %1 \n" \
: "=&r" (result), "=&r" (temp), \ : "=&r" (result), "=&r" (temp), \
...@@ -237,7 +236,7 @@ static __inline__ type arch_##pfx##_sub_if_positive(type i, pfx##_t * v) \ ...@@ -237,7 +236,7 @@ static __inline__ type arch_##pfx##_sub_if_positive(type i, pfx##_t * v) \
" .set push \n" \ " .set push \n" \
" .set " MIPS_ISA_LEVEL " \n" \ " .set " MIPS_ISA_LEVEL " \n" \
" " #sc " %1, %2 \n" \ " " #sc " %1, %2 \n" \
" " __SC_BEQZ "%1, 1b \n" \ " " __stringify(SC_BEQZ) " %1, 1b \n" \
"2: " __SYNC(full, loongson3_war) " \n" \ "2: " __SYNC(full, loongson3_war) " \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r" (result), "=&r" (temp), \ : "=&r" (result), "=&r" (temp), \
......
...@@ -16,14 +16,12 @@ ...@@ -16,14 +16,12 @@
#include <linux/bits.h> #include <linux/bits.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/asm.h>
#include <asm/barrier.h> #include <asm/barrier.h>
#include <asm/byteorder.h> /* sigh ... */ #include <asm/byteorder.h> /* sigh ... */
#include <asm/compiler.h> #include <asm/compiler.h>
#include <asm/cpu-features.h> #include <asm/cpu-features.h>
#include <asm/isa-rev.h>
#include <asm/llsc.h>
#include <asm/sgidefs.h> #include <asm/sgidefs.h>
#include <asm/war.h>
#define __bit_op(mem, insn, inputs...) do { \ #define __bit_op(mem, insn, inputs...) do { \
unsigned long __temp; \ unsigned long __temp; \
...@@ -32,10 +30,10 @@ ...@@ -32,10 +30,10 @@
" .set push \n" \ " .set push \n" \
" .set " MIPS_ISA_LEVEL " \n" \ " .set " MIPS_ISA_LEVEL " \n" \
" " __SYNC(full, loongson3_war) " \n" \ " " __SYNC(full, loongson3_war) " \n" \
"1: " __LL "%0, %1 \n" \ "1: " __stringify(LONG_LL) " %0, %1 \n" \
" " insn " \n" \ " " insn " \n" \
" " __SC "%0, %1 \n" \ " " __stringify(LONG_SC) " %0, %1 \n" \
" " __SC_BEQZ "%0, 1b \n" \ " " __stringify(SC_BEQZ) " %0, 1b \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r"(__temp), "+" GCC_OFF_SMALL_ASM()(mem) \ : "=&r"(__temp), "+" GCC_OFF_SMALL_ASM()(mem) \
: inputs \ : inputs \
...@@ -49,10 +47,10 @@ ...@@ -49,10 +47,10 @@
" .set push \n" \ " .set push \n" \
" .set " MIPS_ISA_LEVEL " \n" \ " .set " MIPS_ISA_LEVEL " \n" \
" " __SYNC(full, loongson3_war) " \n" \ " " __SYNC(full, loongson3_war) " \n" \
"1: " __LL ll_dst ", %2 \n" \ "1: " __stringify(LONG_LL) " " ll_dst ", %2\n" \
" " insn " \n" \ " " insn " \n" \
" " __SC "%1, %2 \n" \ " " __stringify(LONG_SC) " %1, %2 \n" \
" " __SC_BEQZ "%1, 1b \n" \ " " __stringify(SC_BEQZ) " %1, 1b \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r"(__orig), "=&r"(__temp), \ : "=&r"(__orig), "=&r"(__temp), \
"+" GCC_OFF_SMALL_ASM()(mem) \ "+" GCC_OFF_SMALL_ASM()(mem) \
...@@ -98,7 +96,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) ...@@ -98,7 +96,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
} }
if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(bit) && (bit >= 16)) { if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(bit) && (bit >= 16)) {
__bit_op(*m, __INS "%0, %3, %2, 1", "i"(bit), "r"(~0)); __bit_op(*m, __stringify(LONG_INS) " %0, %3, %2, 1", "i"(bit), "r"(~0));
return; return;
} }
...@@ -126,7 +124,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) ...@@ -126,7 +124,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
} }
if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(bit)) { if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(bit)) {
__bit_op(*m, __INS "%0, $0, %2, 1", "i"(bit)); __bit_op(*m, __stringify(LONG_INS) " %0, $0, %2, 1", "i"(bit));
return; return;
} }
...@@ -234,8 +232,8 @@ static inline int test_and_clear_bit(unsigned long nr, ...@@ -234,8 +232,8 @@ static inline int test_and_clear_bit(unsigned long nr,
res = __mips_test_and_clear_bit(nr, addr); res = __mips_test_and_clear_bit(nr, addr);
} else if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(nr)) { } else if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(nr)) {
res = __test_bit_op(*m, "%1", res = __test_bit_op(*m, "%1",
__EXT "%0, %1, %3, 1;" __stringify(LONG_EXT) " %0, %1, %3, 1;"
__INS "%1, $0, %3, 1", __stringify(LONG_INS) " %1, $0, %3, 1",
"i"(bit)); "i"(bit));
} else { } else {
orig = __test_bit_op(*m, "%0", orig = __test_bit_op(*m, "%0",
......
...@@ -10,10 +10,9 @@ ...@@ -10,10 +10,9 @@
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <asm/asm.h>
#include <asm/compiler.h> #include <asm/compiler.h>
#include <asm/llsc.h>
#include <asm/sync.h> #include <asm/sync.h>
#include <asm/war.h>
/* /*
* These functions doesn't exist, so if they are called you'll either: * These functions doesn't exist, so if they are called you'll either:
...@@ -48,7 +47,7 @@ extern unsigned long __xchg_called_with_bad_pointer(void) ...@@ -48,7 +47,7 @@ extern unsigned long __xchg_called_with_bad_pointer(void)
" move $1, %z3 \n" \ " move $1, %z3 \n" \
" .set " MIPS_ISA_ARCH_LEVEL " \n" \ " .set " MIPS_ISA_ARCH_LEVEL " \n" \
" " st " $1, %1 \n" \ " " st " $1, %1 \n" \
"\t" __SC_BEQZ "$1, 1b \n" \ "\t" __stringify(SC_BEQZ) " $1, 1b \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \ : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \
: GCC_OFF_SMALL_ASM() (*m), "Jr" (val) \ : GCC_OFF_SMALL_ASM() (*m), "Jr" (val) \
...@@ -127,7 +126,7 @@ unsigned long __xchg(volatile void *ptr, unsigned long x, int size) ...@@ -127,7 +126,7 @@ unsigned long __xchg(volatile void *ptr, unsigned long x, int size)
" move $1, %z4 \n" \ " move $1, %z4 \n" \
" .set "MIPS_ISA_ARCH_LEVEL" \n" \ " .set "MIPS_ISA_ARCH_LEVEL" \n" \
" " st " $1, %1 \n" \ " " st " $1, %1 \n" \
"\t" __SC_BEQZ "$1, 1b \n" \ "\t" __stringify(SC_BEQZ) " $1, 1b \n" \
" .set pop \n" \ " .set pop \n" \
"2: " __SYNC(full, loongson3_war) " \n" \ "2: " __SYNC(full, loongson3_war) " \n" \
: "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \ : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \
...@@ -282,7 +281,7 @@ static inline unsigned long __cmpxchg64(volatile void *ptr, ...@@ -282,7 +281,7 @@ static inline unsigned long __cmpxchg64(volatile void *ptr,
/* Attempt to store new at ptr */ /* Attempt to store new at ptr */
" scd %L1, %2 \n" " scd %L1, %2 \n"
/* If we failed, loop! */ /* If we failed, loop! */
"\t" __SC_BEQZ "%L1, 1b \n" "\t" __stringify(SC_BEQZ) " %L1, 1b \n"
"2: " __SYNC(full, loongson3_war) " \n" "2: " __SYNC(full, loongson3_war) " \n"
" .set pop \n" " .set pop \n"
: "=&r"(ret), : "=&r"(ret),
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#ifdef CONFIG_32BIT #ifdef CONFIG_32BIT
#define KGDB_GDB_REG_SIZE 32 #define KGDB_GDB_REG_SIZE 32
#define GDB_SIZEOF_REG sizeof(u32) #define GDB_SIZEOF_REG sizeof(u32)
#else /* CONFIG_CPU_32BIT */ #else /* CONFIG_32BIT */
#define KGDB_GDB_REG_SIZE 64 #define KGDB_GDB_REG_SIZE 64
#define GDB_SIZEOF_REG sizeof(u64) #define GDB_SIZEOF_REG sizeof(u64)
#endif #endif
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/asm.h>
#include <asm/inst.h> #include <asm/inst.h>
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
...@@ -379,9 +380,9 @@ static inline void _kvm_atomic_set_c0_guest_reg(unsigned long *reg, ...@@ -379,9 +380,9 @@ static inline void _kvm_atomic_set_c0_guest_reg(unsigned long *reg,
__asm__ __volatile__( __asm__ __volatile__(
" .set push \n" " .set push \n"
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
" " __LL "%0, %1 \n" " "__stringify(LONG_LL) " %0, %1 \n"
" or %0, %2 \n" " or %0, %2 \n"
" " __SC "%0, %1 \n" " "__stringify(LONG_SC) " %0, %1 \n"
" .set pop \n" " .set pop \n"
: "=&r" (temp), "+m" (*reg) : "=&r" (temp), "+m" (*reg)
: "r" (val)); : "r" (val));
...@@ -396,9 +397,9 @@ static inline void _kvm_atomic_clear_c0_guest_reg(unsigned long *reg, ...@@ -396,9 +397,9 @@ static inline void _kvm_atomic_clear_c0_guest_reg(unsigned long *reg,
__asm__ __volatile__( __asm__ __volatile__(
" .set push \n" " .set push \n"
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
" " __LL "%0, %1 \n" " "__stringify(LONG_LL) " %0, %1 \n"
" and %0, %2 \n" " and %0, %2 \n"
" " __SC "%0, %1 \n" " "__stringify(LONG_SC) " %0, %1 \n"
" .set pop \n" " .set pop \n"
: "=&r" (temp), "+m" (*reg) : "=&r" (temp), "+m" (*reg)
: "r" (~val)); : "r" (~val));
...@@ -414,10 +415,10 @@ static inline void _kvm_atomic_change_c0_guest_reg(unsigned long *reg, ...@@ -414,10 +415,10 @@ static inline void _kvm_atomic_change_c0_guest_reg(unsigned long *reg,
__asm__ __volatile__( __asm__ __volatile__(
" .set push \n" " .set push \n"
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
" " __LL "%0, %1 \n" " "__stringify(LONG_LL) " %0, %1 \n"
" and %0, %2 \n" " and %0, %2 \n"
" or %0, %3 \n" " or %0, %3 \n"
" " __SC "%0, %1 \n" " "__stringify(LONG_SC) " %0, %1 \n"
" .set pop \n" " .set pop \n"
: "=&r" (temp), "+m" (*reg) : "=&r" (temp), "+m" (*reg)
: "r" (~change), "r" (val & change)); : "r" (~change), "r" (val & change));
......
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Macros for 32/64-bit neutral inline assembler
*/
#ifndef __ASM_LLSC_H
#define __ASM_LLSC_H
#include <asm/isa-rev.h>
#if _MIPS_SZLONG == 32
#define __LL "ll "
#define __SC "sc "
#define __INS "ins "
#define __EXT "ext "
#elif _MIPS_SZLONG == 64
#define __LL "lld "
#define __SC "scd "
#define __INS "dins "
#define __EXT "dext "
#endif
/*
* Using a branch-likely instruction to check the result of an sc instruction
* works around a bug present in R10000 CPUs prior to revision 3.0 that could
* cause ll-sc sequences to execute non-atomically.
*/
#ifdef CONFIG_WAR_R10000_LLSC
# define __SC_BEQZ "beqzl "
#elif MIPS_ISA_REV >= 6
# define __SC_BEQZ "beqzc "
#else
# define __SC_BEQZ "beqz "
#endif
#endif /* __ASM_LLSC_H */
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/asm.h>
#include <asm/cmpxchg.h> #include <asm/cmpxchg.h>
#include <asm/compiler.h> #include <asm/compiler.h>
#include <asm/war.h>
typedef struct typedef struct
{ {
...@@ -31,34 +31,18 @@ static __inline__ long local_add_return(long i, local_t * l) ...@@ -31,34 +31,18 @@ static __inline__ long local_add_return(long i, local_t * l)
{ {
unsigned long result; unsigned long result;
if (kernel_uses_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { if (kernel_uses_llsc) {
unsigned long temp;
__asm__ __volatile__(
" .set push \n"
" .set arch=r4000 \n"
__SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_add_return \n"
" addu %0, %1, %3 \n"
__SC "%0, %2 \n"
" beqzl %0, 1b \n"
" addu %0, %1, %3 \n"
" .set pop \n"
: "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
: "Ir" (i), "m" (l->a.counter)
: "memory");
} else if (kernel_uses_llsc) {
unsigned long temp; unsigned long temp;
__asm__ __volatile__( __asm__ __volatile__(
" .set push \n" " .set push \n"
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
__SYNC(full, loongson3_war) " \n" __SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_add_return \n" "1:" __stringify(LONG_LL) " %1, %2 \n"
" addu %0, %1, %3 \n" __stringify(LONG_ADDU) " %0, %1, %3 \n"
__SC "%0, %2 \n" __stringify(LONG_SC) " %0, %2 \n"
" beqz %0, 1b \n" __stringify(SC_BEQZ) " %0, 1b \n"
" addu %0, %1, %3 \n" __stringify(LONG_ADDU) " %0, %1, %3 \n"
" .set pop \n" " .set pop \n"
: "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
: "Ir" (i), "m" (l->a.counter) : "Ir" (i), "m" (l->a.counter)
...@@ -80,34 +64,19 @@ static __inline__ long local_sub_return(long i, local_t * l) ...@@ -80,34 +64,19 @@ static __inline__ long local_sub_return(long i, local_t * l)
{ {
unsigned long result; unsigned long result;
if (kernel_uses_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) { if (kernel_uses_llsc) {
unsigned long temp;
__asm__ __volatile__(
" .set push \n"
" .set arch=r4000 \n"
__SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_sub_return \n"
" subu %0, %1, %3 \n"
__SC "%0, %2 \n"
" beqzl %0, 1b \n"
" subu %0, %1, %3 \n"
" .set pop \n"
: "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
: "Ir" (i), "m" (l->a.counter)
: "memory");
} else if (kernel_uses_llsc) {
unsigned long temp; unsigned long temp;
__asm__ __volatile__( __asm__ __volatile__(
" .set push \n" " .set push \n"
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
__SYNC(full, loongson3_war) " \n" __SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_sub_return \n" "1:" __stringify(LONG_LL) " %1, %2 \n"
" subu %0, %1, %3 \n" __stringify(LONG_SUBU) " %0, %1, %3 \n"
__SC "%0, %2 \n" __stringify(LONG_SUBU) " %0, %1, %3 \n"
" beqz %0, 1b \n" __stringify(LONG_SC) " %0, %2 \n"
" subu %0, %1, %3 \n" __stringify(SC_BEQZ) " %0, 1b \n"
__stringify(LONG_SUBU) " %0, %1, %3 \n"
" .set pop \n" " .set pop \n"
: "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
: "Ir" (i), "m" (l->a.counter) : "Ir" (i), "m" (l->a.counter)
......
...@@ -72,6 +72,7 @@ enum bcm47xx_board { ...@@ -72,6 +72,7 @@ enum bcm47xx_board {
BCM47XX_BOARD_LINKSYS_WRT300NV11, BCM47XX_BOARD_LINKSYS_WRT300NV11,
BCM47XX_BOARD_LINKSYS_WRT310NV1, BCM47XX_BOARD_LINKSYS_WRT310NV1,
BCM47XX_BOARD_LINKSYS_WRT310NV2, BCM47XX_BOARD_LINKSYS_WRT310NV2,
BCM47XX_BOARD_LINKSYS_WRT320N_V1,
BCM47XX_BOARD_LINKSYS_WRT54G3GV2, BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101, BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467, BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,
...@@ -99,9 +100,12 @@ enum bcm47xx_board { ...@@ -99,9 +100,12 @@ enum bcm47xx_board {
BCM47XX_BOARD_MOTOROLA_WR850GV2V3, BCM47XX_BOARD_MOTOROLA_WR850GV2V3,
BCM47XX_BOARD_NETGEAR_R6200_V1, BCM47XX_BOARD_NETGEAR_R6200_V1,
BCM47XX_BOARD_NETGEAR_R6300_V1,
BCM47XX_BOARD_NETGEAR_WGR614V8, BCM47XX_BOARD_NETGEAR_WGR614V8,
BCM47XX_BOARD_NETGEAR_WGR614V9, BCM47XX_BOARD_NETGEAR_WGR614V9,
BCM47XX_BOARD_NETGEAR_WGR614_V10, BCM47XX_BOARD_NETGEAR_WGR614_V10,
BCM47XX_BOARD_NETGEAR_WN2500RP_V1,
BCM47XX_BOARD_NETGEAR_WN2500RP_V2,
BCM47XX_BOARD_NETGEAR_WNDR3300, BCM47XX_BOARD_NETGEAR_WNDR3300,
BCM47XX_BOARD_NETGEAR_WNDR3400V1, BCM47XX_BOARD_NETGEAR_WNDR3400V1,
BCM47XX_BOARD_NETGEAR_WNDR3400V2, BCM47XX_BOARD_NETGEAR_WNDR3400V2,
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
nop nop
/* Loongson-3A R2/R3 */ /* Loongson-3A R2/R3 */
andi t0, (PRID_IMP_MASK | PRID_REV_MASK) andi t0, (PRID_IMP_MASK | PRID_REV_MASK)
slti t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) slti t0, t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)
bnez t0, 2f bnez t0, 2f
nop nop
1: 1:
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
nop nop
/* Loongson-3A R2/R3 */ /* Loongson-3A R2/R3 */
andi t0, (PRID_IMP_MASK | PRID_REV_MASK) andi t0, (PRID_IMP_MASK | PRID_REV_MASK)
slti t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) slti t0, t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)
bnez t0, 2f bnez t0, 2f
nop nop
1: 1:
......
...@@ -9,16 +9,8 @@ ...@@ -9,16 +9,8 @@
#define ioswabb(a, x) (x) #define ioswabb(a, x) (x)
#define __mem_ioswabb(a, x) (x) #define __mem_ioswabb(a, x) (x)
#if defined(CONFIG_TOSHIBA_RBTX4939) && \
IS_ENABLED(CONFIG_SMC91X) && \
defined(__BIG_ENDIAN)
#define NEEDS_TXX9_IOSWABW
extern u16 (*ioswabw)(volatile u16 *a, u16 x);
extern u16 (*__mem_ioswabw)(volatile u16 *a, u16 x);
#else
#define ioswabw(a, x) le16_to_cpu((__force __le16)(x)) #define ioswabw(a, x) le16_to_cpu((__force __le16)(x))
#define __mem_ioswabw(a, x) (x) #define __mem_ioswabw(a, x) (x)
#endif
#define ioswabl(a, x) le32_to_cpu((__force __le32)(x)) #define ioswabl(a, x) le32_to_cpu((__force __le32)(x))
#define __mem_ioswabl(a, x) (x) #define __mem_ioswabl(a, x) (x)
#define ioswabq(a, x) le64_to_cpu((__force __le64)(x)) #define ioswabq(a, x) le64_to_cpu((__force __le64)(x))
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#ifndef __MIPS_ASM_MIPS_CPS_H__ #ifndef __MIPS_ASM_MIPS_CPS_H__
#define __MIPS_ASM_MIPS_CPS_H__ #define __MIPS_ASM_MIPS_CPS_H__
#include <linux/bitfield.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -112,14 +113,10 @@ static inline void clear_##unit##_##name(uint##sz##_t val) \ ...@@ -112,14 +113,10 @@ static inline void clear_##unit##_##name(uint##sz##_t val) \
*/ */
static inline unsigned int mips_cps_numclusters(void) static inline unsigned int mips_cps_numclusters(void)
{ {
unsigned int num_clusters;
if (mips_cm_revision() < CM_REV_CM3_5) if (mips_cm_revision() < CM_REV_CM3_5)
return 1; return 1;
num_clusters = read_gcr_config() & CM_GCR_CONFIG_NUM_CLUSTERS; return FIELD_GET(CM_GCR_CONFIG_NUM_CLUSTERS, read_gcr_config());
num_clusters >>= __ffs(CM_GCR_CONFIG_NUM_CLUSTERS);
return num_clusters;
} }
/** /**
...@@ -169,7 +166,8 @@ static inline unsigned int mips_cps_numcores(unsigned int cluster) ...@@ -169,7 +166,8 @@ static inline unsigned int mips_cps_numcores(unsigned int cluster)
return 0; return 0;
/* Add one before masking to handle 0xff indicating no cores */ /* Add one before masking to handle 0xff indicating no cores */
return (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES; return FIELD_GET(CM_GCR_CONFIG_PCORES,
mips_cps_cluster_config(cluster) + 1);
} }
/** /**
...@@ -181,14 +179,11 @@ static inline unsigned int mips_cps_numcores(unsigned int cluster) ...@@ -181,14 +179,11 @@ static inline unsigned int mips_cps_numcores(unsigned int cluster)
*/ */
static inline unsigned int mips_cps_numiocu(unsigned int cluster) static inline unsigned int mips_cps_numiocu(unsigned int cluster)
{ {
unsigned int num_iocu;
if (!mips_cm_present()) if (!mips_cm_present())
return 0; return 0;
num_iocu = mips_cps_cluster_config(cluster) & CM_GCR_CONFIG_NUMIOCU; return FIELD_GET(CM_GCR_CONFIG_NUMIOCU,
num_iocu >>= __ffs(CM_GCR_CONFIG_NUMIOCU); mips_cps_cluster_config(cluster));
return num_iocu;
} }
/** /**
...@@ -230,7 +225,7 @@ static inline unsigned int mips_cps_numvps(unsigned int cluster, unsigned int co ...@@ -230,7 +225,7 @@ static inline unsigned int mips_cps_numvps(unsigned int cluster, unsigned int co
mips_cm_unlock_other(); mips_cm_unlock_other();
return (cfg + 1) & CM_GCR_Cx_CONFIG_PVPE; return FIELD_GET(CM_GCR_Cx_CONFIG_PVPE, cfg + 1);
} }
#endif /* __MIPS_ASM_MIPS_CPS_H__ */ #endif /* __MIPS_ASM_MIPS_CPS_H__ */
...@@ -318,7 +318,7 @@ enum cvmx_chip_types_enum { ...@@ -318,7 +318,7 @@ enum cvmx_chip_types_enum {
/* Functions to return string based on type */ /* Functions to return string based on type */
#define ENUM_BRD_TYPE_CASE(x) \ #define ENUM_BRD_TYPE_CASE(x) \
case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */ case x: return (&#x[16]); /* Skip CVMX_BOARD_TYPE_ */
static inline const char *cvmx_board_type_to_string(enum static inline const char *cvmx_board_type_to_string(enum
cvmx_board_types_enum type) cvmx_board_types_enum type)
{ {
...@@ -410,7 +410,7 @@ static inline const char *cvmx_board_type_to_string(enum ...@@ -410,7 +410,7 @@ static inline const char *cvmx_board_type_to_string(enum
} }
#define ENUM_CHIP_TYPE_CASE(x) \ #define ENUM_CHIP_TYPE_CASE(x) \
case x: return(#x + 15); /* Skip CVMX_CHIP_TYPE */ case x: return (&#x[15]); /* Skip CVMX_CHIP_TYPE */
static inline const char *cvmx_chip_type_to_string(enum static inline const char *cvmx_chip_type_to_string(enum
cvmx_chip_types_enum type) cvmx_chip_types_enum type)
{ {
......
...@@ -484,7 +484,7 @@ ...@@ -484,7 +484,7 @@
/* /*
* Bank Address Address Bits Register (Table 6-22) * Bank Address Bits Register (Table 6-22)
*/ */
#define S_MC_BA_RESERVED 0 #define S_MC_BA_RESERVED 0
......
...@@ -101,6 +101,9 @@ static inline int register_vsmp_smp_ops(void) ...@@ -101,6 +101,9 @@ static inline int register_vsmp_smp_ops(void)
#ifdef CONFIG_MIPS_MT_SMP #ifdef CONFIG_MIPS_MT_SMP
extern const struct plat_smp_ops vsmp_smp_ops; extern const struct plat_smp_ops vsmp_smp_ops;
if (!cpu_has_mipsmt)
return -ENODEV;
register_smp_ops(&vsmp_smp_ops); register_smp_ops(&vsmp_smp_ops);
return 0; return 0;
......
...@@ -6,9 +6,3 @@ BOARD_VEC(jmr3927_vec) ...@@ -6,9 +6,3 @@ BOARD_VEC(jmr3927_vec)
BOARD_VEC(rbtx4927_vec) BOARD_VEC(rbtx4927_vec)
BOARD_VEC(rbtx4937_vec) BOARD_VEC(rbtx4937_vec)
#endif #endif
#ifdef CONFIG_TOSHIBA_RBTX4938
BOARD_VEC(rbtx4938_vec)
#endif
#ifdef CONFIG_TOSHIBA_RBTX4939
BOARD_VEC(rbtx4939_vec)
#endif
/*
* Definitions for TX4937/TX4938
*
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
*/
#ifndef __ASM_TXX9_RBTX4938_H
#define __ASM_TXX9_RBTX4938_H
#include <asm/addrspace.h>
#include <asm/txx9irq.h>
#include <asm/txx9/tx4938.h>
/* Address map */
#define RBTX4938_FPGA_REG_ADDR (IO_BASE + TXX9_CE(2) + 0x00000000)
#define RBTX4938_FPGA_REV_ADDR (IO_BASE + TXX9_CE(2) + 0x00000002)
#define RBTX4938_CONFIG1_ADDR (IO_BASE + TXX9_CE(2) + 0x00000004)
#define RBTX4938_CONFIG2_ADDR (IO_BASE + TXX9_CE(2) + 0x00000006)
#define RBTX4938_CONFIG3_ADDR (IO_BASE + TXX9_CE(2) + 0x00000008)
#define RBTX4938_LED_ADDR (IO_BASE + TXX9_CE(2) + 0x00001000)
#define RBTX4938_DIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001002)
#define RBTX4938_BDIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001004)
#define RBTX4938_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000)
#define RBTX4938_IMASK2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002002)
#define RBTX4938_INTPOL_ADDR (IO_BASE + TXX9_CE(2) + 0x00002004)
#define RBTX4938_ISTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006)
#define RBTX4938_ISTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002008)
#define RBTX4938_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200a)
#define RBTX4938_IMSTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200c)
#define RBTX4938_SOFTINT_ADDR (IO_BASE + TXX9_CE(2) + 0x00003000)
#define RBTX4938_PIOSEL_ADDR (IO_BASE + TXX9_CE(2) + 0x00005000)
#define RBTX4938_SPICS_ADDR (IO_BASE + TXX9_CE(2) + 0x00005002)
#define RBTX4938_SFPWR_ADDR (IO_BASE + TXX9_CE(2) + 0x00005008)
#define RBTX4938_SFVOL_ADDR (IO_BASE + TXX9_CE(2) + 0x0000500a)
#define RBTX4938_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007000)
#define RBTX4938_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x00007002)
#define RBTX4938_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007004)
#define RBTX4938_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000)
/* Ethernet port address (Jumperless Mode (W12:Open)) */
#define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280)
/* bits for ISTAT/IMASK/IMSTAT */
#define RBTX4938_INTB_PCID 0
#define RBTX4938_INTB_PCIC 1
#define RBTX4938_INTB_PCIB 2
#define RBTX4938_INTB_PCIA 3
#define RBTX4938_INTB_RTC 4
#define RBTX4938_INTB_ATA 5
#define RBTX4938_INTB_MODEM 6
#define RBTX4938_INTB_SWINT 7
#define RBTX4938_INTF_PCID (1 << RBTX4938_INTB_PCID)
#define RBTX4938_INTF_PCIC (1 << RBTX4938_INTB_PCIC)
#define RBTX4938_INTF_PCIB (1 << RBTX4938_INTB_PCIB)
#define RBTX4938_INTF_PCIA (1 << RBTX4938_INTB_PCIA)
#define RBTX4938_INTF_RTC (1 << RBTX4938_INTB_RTC)
#define RBTX4938_INTF_ATA (1 << RBTX4938_INTB_ATA)
#define RBTX4938_INTF_MODEM (1 << RBTX4938_INTB_MODEM)
#define RBTX4938_INTF_SWINT (1 << RBTX4938_INTB_SWINT)
#define rbtx4938_fpga_rev_addr ((__u8 __iomem *)RBTX4938_FPGA_REV_ADDR)
#define rbtx4938_led_addr ((__u8 __iomem *)RBTX4938_LED_ADDR)
#define rbtx4938_dipsw_addr ((__u8 __iomem *)RBTX4938_DIPSW_ADDR)
#define rbtx4938_bdipsw_addr ((__u8 __iomem *)RBTX4938_BDIPSW_ADDR)
#define rbtx4938_imask_addr ((__u8 __iomem *)RBTX4938_IMASK_ADDR)
#define rbtx4938_imask2_addr ((__u8 __iomem *)RBTX4938_IMASK2_ADDR)
#define rbtx4938_intpol_addr ((__u8 __iomem *)RBTX4938_INTPOL_ADDR)
#define rbtx4938_istat_addr ((__u8 __iomem *)RBTX4938_ISTAT_ADDR)
#define rbtx4938_istat2_addr ((__u8 __iomem *)RBTX4938_ISTAT2_ADDR)
#define rbtx4938_imstat_addr ((__u8 __iomem *)RBTX4938_IMSTAT_ADDR)
#define rbtx4938_imstat2_addr ((__u8 __iomem *)RBTX4938_IMSTAT2_ADDR)
#define rbtx4938_softint_addr ((__u8 __iomem *)RBTX4938_SOFTINT_ADDR)
#define rbtx4938_piosel_addr ((__u8 __iomem *)RBTX4938_PIOSEL_ADDR)
#define rbtx4938_spics_addr ((__u8 __iomem *)RBTX4938_SPICS_ADDR)
#define rbtx4938_sfpwr_addr ((__u8 __iomem *)RBTX4938_SFPWR_ADDR)
#define rbtx4938_sfvol_addr ((__u8 __iomem *)RBTX4938_SFVOL_ADDR)
#define rbtx4938_softreset_addr ((__u8 __iomem *)RBTX4938_SOFTRESET_ADDR)
#define rbtx4938_softresetlock_addr \
((__u8 __iomem *)RBTX4938_SOFTRESETLOCK_ADDR)
#define rbtx4938_pcireset_addr ((__u8 __iomem *)RBTX4938_PCIRESET_ADDR)
/*
* IRQ mappings
*/
#define RBTX4938_SOFT_INT0 0 /* not used */
#define RBTX4938_SOFT_INT1 1 /* not used */
#define RBTX4938_IRC_INT 2
#define RBTX4938_TIMER_INT 7
/* These are the virtual IRQ numbers, we divide all IRQ's into
* 'spaces', the 'space' determines where and how to enable/disable
* that particular IRQ on an RBTX4938 machine. Add new 'spaces' as new
* IRQ hardware is supported.
*/
#define RBTX4938_NR_IRQ_IOC 8
#define RBTX4938_IRQ_IRC TXX9_IRQ_BASE
#define RBTX4938_IRQ_IOC (TXX9_IRQ_BASE + TX4938_NUM_IR)
#define RBTX4938_IRQ_END (RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC)
#define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR)
#define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR)
#define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n))
#define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n))
#define RBTX4938_IRQ_IRC_DMA(ch, n) (RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch, n))
#define RBTX4938_IRQ_IRC_PIO (RBTX4938_IRQ_IRC + TX4938_IR_PIO)
#define RBTX4938_IRQ_IRC_PDMAC (RBTX4938_IRQ_IRC + TX4938_IR_PDMAC)
#define RBTX4938_IRQ_IRC_PCIC (RBTX4938_IRQ_IRC + TX4938_IR_PCIC)
#define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n))
#define RBTX4938_IRQ_IRC_NDFMC (RBTX4938_IRQ_IRC + TX4938_IR_NDFMC)
#define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR)
#define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME)
#define RBTX4938_IRQ_IRC_ACLC (RBTX4938_IRQ_IRC + TX4938_IR_ACLC)
#define RBTX4938_IRQ_IRC_ACLCPME (RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME)
#define RBTX4938_IRQ_IRC_PCIC1 (RBTX4938_IRQ_IRC + TX4938_IR_PCIC1)
#define RBTX4938_IRQ_IRC_SPI (RBTX4938_IRQ_IRC + TX4938_IR_SPI)
#define RBTX4938_IRQ_IOC_PCID (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID)
#define RBTX4938_IRQ_IOC_PCIC (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC)
#define RBTX4938_IRQ_IOC_PCIB (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB)
#define RBTX4938_IRQ_IOC_PCIA (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA)
#define RBTX4938_IRQ_IOC_RTC (RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC)
#define RBTX4938_IRQ_IOC_ATA (RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA)
#define RBTX4938_IRQ_IOC_MODEM (RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM)
#define RBTX4938_IRQ_IOC_SWINT (RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT)
/* IOC (PCI, etc) */
#define RBTX4938_IRQ_IOCINT (TXX9_IRQ_BASE + TX4938_IR_INT(0))
/* Onboard 10M Ether */
#define RBTX4938_IRQ_ETHER (TXX9_IRQ_BASE + TX4938_IR_INT(1))
#define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base)
#define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER)
void rbtx4938_prom_init(void);
void rbtx4938_irq_setup(void);
struct pci_dev;
int rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
#endif /* __ASM_TXX9_RBTX4938_H */
/*
* Definitions for RBTX4939
*
* (C) Copyright TOSHIBA CORPORATION 2005-2006
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#ifndef __ASM_TXX9_RBTX4939_H
#define __ASM_TXX9_RBTX4939_H
#include <asm/addrspace.h>
#include <asm/txx9irq.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/tx4939.h>
/* Address map */
#define RBTX4939_IOC_REG_ADDR (IO_BASE + TXX9_CE(1) + 0x00000000)
#define RBTX4939_BOARD_REV_ADDR (IO_BASE + TXX9_CE(1) + 0x00000000)
#define RBTX4939_IOC_REV_ADDR (IO_BASE + TXX9_CE(1) + 0x00000002)
#define RBTX4939_CONFIG1_ADDR (IO_BASE + TXX9_CE(1) + 0x00000004)
#define RBTX4939_CONFIG2_ADDR (IO_BASE + TXX9_CE(1) + 0x00000006)
#define RBTX4939_CONFIG3_ADDR (IO_BASE + TXX9_CE(1) + 0x00000008)
#define RBTX4939_CONFIG4_ADDR (IO_BASE + TXX9_CE(1) + 0x0000000a)
#define RBTX4939_USTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00001000)
#define RBTX4939_UDIPSW_ADDR (IO_BASE + TXX9_CE(1) + 0x00001002)
#define RBTX4939_BDIPSW_ADDR (IO_BASE + TXX9_CE(1) + 0x00001004)
#define RBTX4939_IEN_ADDR (IO_BASE + TXX9_CE(1) + 0x00002000)
#define RBTX4939_IPOL_ADDR (IO_BASE + TXX9_CE(1) + 0x00002002)
#define RBTX4939_IFAC1_ADDR (IO_BASE + TXX9_CE(1) + 0x00002004)
#define RBTX4939_IFAC2_ADDR (IO_BASE + TXX9_CE(1) + 0x00002006)
#define RBTX4939_SOFTINT_ADDR (IO_BASE + TXX9_CE(1) + 0x00003000)
#define RBTX4939_ISASTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00004000)
#define RBTX4939_PCISTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00004002)
#define RBTX4939_ROME_ADDR (IO_BASE + TXX9_CE(1) + 0x00004004)
#define RBTX4939_SPICS_ADDR (IO_BASE + TXX9_CE(1) + 0x00004006)
#define RBTX4939_AUDI_ADDR (IO_BASE + TXX9_CE(1) + 0x00004008)
#define RBTX4939_ISAGPIO_ADDR (IO_BASE + TXX9_CE(1) + 0x0000400a)
#define RBTX4939_PE1_ADDR (IO_BASE + TXX9_CE(1) + 0x00005000)
#define RBTX4939_PE2_ADDR (IO_BASE + TXX9_CE(1) + 0x00005002)
#define RBTX4939_PE3_ADDR (IO_BASE + TXX9_CE(1) + 0x00005004)
#define RBTX4939_VP_ADDR (IO_BASE + TXX9_CE(1) + 0x00005006)
#define RBTX4939_VPRESET_ADDR (IO_BASE + TXX9_CE(1) + 0x00005008)
#define RBTX4939_VPSOUT_ADDR (IO_BASE + TXX9_CE(1) + 0x0000500a)
#define RBTX4939_VPSIN_ADDR (IO_BASE + TXX9_CE(1) + 0x0000500c)
#define RBTX4939_7SEG_ADDR(s, ch) \
(IO_BASE + TXX9_CE(1) + 0x00006000 + (s) * 16 + ((ch) & 3) * 2)
#define RBTX4939_SOFTRESET_ADDR (IO_BASE + TXX9_CE(1) + 0x00007000)
#define RBTX4939_RESETEN_ADDR (IO_BASE + TXX9_CE(1) + 0x00007002)
#define RBTX4939_RESETSTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00007004)
#define RBTX4939_ETHER_BASE (IO_BASE + TXX9_CE(1) + 0x00020000)
/* Ethernet port address */
#define RBTX4939_ETHER_ADDR (RBTX4939_ETHER_BASE + 0x300)
/* bits for IEN/IPOL/IFAC */
#define RBTX4938_INTB_ISA0 0
#define RBTX4938_INTB_ISA11 1
#define RBTX4938_INTB_ISA12 2
#define RBTX4938_INTB_ISA15 3
#define RBTX4938_INTB_I2S 4
#define RBTX4938_INTB_SW 5
#define RBTX4938_INTF_ISA0 (1 << RBTX4938_INTB_ISA0)
#define RBTX4938_INTF_ISA11 (1 << RBTX4938_INTB_ISA11)
#define RBTX4938_INTF_ISA12 (1 << RBTX4938_INTB_ISA12)
#define RBTX4938_INTF_ISA15 (1 << RBTX4938_INTB_ISA15)
#define RBTX4938_INTF_I2S (1 << RBTX4938_INTB_I2S)
#define RBTX4938_INTF_SW (1 << RBTX4938_INTB_SW)
/* bits for PE1,PE2,PE3 */
#define RBTX4939_PE1_ATA(ch) (0x01 << (ch))
#define RBTX4939_PE1_RMII(ch) (0x04 << (ch))
#define RBTX4939_PE2_SIO0 0x01
#define RBTX4939_PE2_SIO2 0x02
#define RBTX4939_PE2_SIO3 0x04
#define RBTX4939_PE2_CIR 0x08
#define RBTX4939_PE2_SPI 0x10
#define RBTX4939_PE2_GPIO 0x20
#define RBTX4939_PE3_VP 0x01
#define RBTX4939_PE3_VP_P 0x02
#define RBTX4939_PE3_VP_S 0x04
#define rbtx4939_board_rev_addr ((u8 __iomem *)RBTX4939_BOARD_REV_ADDR)
#define rbtx4939_ioc_rev_addr ((u8 __iomem *)RBTX4939_IOC_REV_ADDR)
#define rbtx4939_config1_addr ((u8 __iomem *)RBTX4939_CONFIG1_ADDR)
#define rbtx4939_config2_addr ((u8 __iomem *)RBTX4939_CONFIG2_ADDR)
#define rbtx4939_config3_addr ((u8 __iomem *)RBTX4939_CONFIG3_ADDR)
#define rbtx4939_config4_addr ((u8 __iomem *)RBTX4939_CONFIG4_ADDR)
#define rbtx4939_ustat_addr ((u8 __iomem *)RBTX4939_USTAT_ADDR)
#define rbtx4939_udipsw_addr ((u8 __iomem *)RBTX4939_UDIPSW_ADDR)
#define rbtx4939_bdipsw_addr ((u8 __iomem *)RBTX4939_BDIPSW_ADDR)
#define rbtx4939_ien_addr ((u8 __iomem *)RBTX4939_IEN_ADDR)
#define rbtx4939_ipol_addr ((u8 __iomem *)RBTX4939_IPOL_ADDR)
#define rbtx4939_ifac1_addr ((u8 __iomem *)RBTX4939_IFAC1_ADDR)
#define rbtx4939_ifac2_addr ((u8 __iomem *)RBTX4939_IFAC2_ADDR)
#define rbtx4939_softint_addr ((u8 __iomem *)RBTX4939_SOFTINT_ADDR)
#define rbtx4939_isastat_addr ((u8 __iomem *)RBTX4939_ISASTAT_ADDR)
#define rbtx4939_pcistat_addr ((u8 __iomem *)RBTX4939_PCISTAT_ADDR)
#define rbtx4939_rome_addr ((u8 __iomem *)RBTX4939_ROME_ADDR)
#define rbtx4939_spics_addr ((u8 __iomem *)RBTX4939_SPICS_ADDR)
#define rbtx4939_audi_addr ((u8 __iomem *)RBTX4939_AUDI_ADDR)
#define rbtx4939_isagpio_addr ((u8 __iomem *)RBTX4939_ISAGPIO_ADDR)
#define rbtx4939_pe1_addr ((u8 __iomem *)RBTX4939_PE1_ADDR)
#define rbtx4939_pe2_addr ((u8 __iomem *)RBTX4939_PE2_ADDR)
#define rbtx4939_pe3_addr ((u8 __iomem *)RBTX4939_PE3_ADDR)
#define rbtx4939_vp_addr ((u8 __iomem *)RBTX4939_VP_ADDR)
#define rbtx4939_vpreset_addr ((u8 __iomem *)RBTX4939_VPRESET_ADDR)
#define rbtx4939_vpsout_addr ((u8 __iomem *)RBTX4939_VPSOUT_ADDR)
#define rbtx4939_vpsin_addr ((u8 __iomem *)RBTX4939_VPSIN_ADDR)
#define rbtx4939_7seg_addr(s, ch) \
((u8 __iomem *)RBTX4939_7SEG_ADDR(s, ch))
#define rbtx4939_softreset_addr ((u8 __iomem *)RBTX4939_SOFTRESET_ADDR)
#define rbtx4939_reseten_addr ((u8 __iomem *)RBTX4939_RESETEN_ADDR)
#define rbtx4939_resetstat_addr ((u8 __iomem *)RBTX4939_RESETSTAT_ADDR)
/*
* IRQ mappings
*/
#define RBTX4939_NR_IRQ_IOC 8
#define RBTX4939_IRQ_IOC (TXX9_IRQ_BASE + TX4939_NUM_IR)
#define RBTX4939_IRQ_END (RBTX4939_IRQ_IOC + RBTX4939_NR_IRQ_IOC)
/* IOC (ISA, etc) */
#define RBTX4939_IRQ_IOCINT (TXX9_IRQ_BASE + TX4939_IR_INT(0))
/* Onboard 10M Ether */
#define RBTX4939_IRQ_ETHER (TXX9_IRQ_BASE + TX4939_IR_INT(1))
void rbtx4939_prom_init(void);
void rbtx4939_irq_setup(void);
struct mtd_partition;
struct map_info;
struct rbtx4939_flash_data {
unsigned int width;
unsigned int nr_parts;
struct mtd_partition *parts;
void (*map_init)(struct map_info *map);
};
#endif /* __ASM_TXX9_RBTX4939_H */
/*
* Definitions for TX4937/TX4938 SPI
*
* Copyright (C) 2000-2001 Toshiba Corporation
*
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
*/
#ifndef __ASM_TXX9_SPI_H
#define __ASM_TXX9_SPI_H
#include <linux/errno.h>
#ifdef CONFIG_SPI
int spi_eeprom_register(int busid, int chipid, int size);
int spi_eeprom_read(int busid, int chipid,
int address, unsigned char *buf, int len);
#else
static inline int spi_eeprom_register(int busid, int chipid, int size)
{
return -ENODEV;
}
static inline int spi_eeprom_read(int busid, int chipid,
int address, unsigned char *buf, int len)
{
return -ENODEV;
}
#endif
#endif /* __ASM_TXX9_SPI_H */
This diff is collapsed.
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Author: Paul Burton <paul.burton@mips.com> * Author: Paul Burton <paul.burton@mips.com>
*/ */
#include <linux/bitfield.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -97,7 +98,7 @@ void mips_cpc_lock_other(unsigned int core) ...@@ -97,7 +98,7 @@ void mips_cpc_lock_other(unsigned int core)
curr_core = cpu_core(&current_cpu_data); curr_core = cpu_core(&current_cpu_data);
spin_lock_irqsave(&per_cpu(cpc_core_lock, curr_core), spin_lock_irqsave(&per_cpu(cpc_core_lock, curr_core),
per_cpu(cpc_core_lock_flags, curr_core)); per_cpu(cpc_core_lock_flags, curr_core));
write_cpc_cl_other(core << __ffs(CPC_Cx_OTHER_CORENUM)); write_cpc_cl_other(FIELD_PREP(CPC_Cx_OTHER_CORENUM, core));
/* /*
* Ensure the core-other region reflects the appropriate core & * Ensure the core-other region reflects the appropriate core &
......
...@@ -562,6 +562,13 @@ void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, ...@@ -562,6 +562,13 @@ void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs,
/* Default to using normal stack */ /* Default to using normal stack */
sp = regs->regs[29]; sp = regs->regs[29];
/*
* If we are on the alternate signal stack and would overflow it, don't.
* Return an always-bogus address instead so we will die with SIGSEGV.
*/
if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
return (void __user __force *)(-1UL);
/* /*
* FPU emulator may have it's own trampoline active just * FPU emulator may have it's own trampoline active just
* above the user stack, 16-bytes before the next lowest * above the user stack, 16-bytes before the next lowest
...@@ -747,23 +754,25 @@ static int setup_rt_frame(void *sig_return, struct ksignal *ksig, ...@@ -747,23 +754,25 @@ static int setup_rt_frame(void *sig_return, struct ksignal *ksig,
struct pt_regs *regs, sigset_t *set) struct pt_regs *regs, sigset_t *set)
{ {
struct rt_sigframe __user *frame; struct rt_sigframe __user *frame;
int err = 0;
frame = get_sigframe(ksig, regs, sizeof(*frame)); frame = get_sigframe(ksig, regs, sizeof(*frame));
if (!access_ok(frame, sizeof (*frame))) if (!access_ok(frame, sizeof (*frame)))
return -EFAULT; return -EFAULT;
/* Create siginfo. */ /* Create siginfo. */
err |= copy_siginfo_to_user(&frame->rs_info, &ksig->info); if (copy_siginfo_to_user(&frame->rs_info, &ksig->info))
return -EFAULT;
/* Create the ucontext. */ /* Create the ucontext. */
err |= __put_user(0, &frame->rs_uc.uc_flags); if (__put_user(0, &frame->rs_uc.uc_flags))
err |= __put_user(NULL, &frame->rs_uc.uc_link); return -EFAULT;
err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]); if (__put_user(NULL, &frame->rs_uc.uc_link))
err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); return -EFAULT;
err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); if (__save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]))
return -EFAULT;
if (err) if (setup_sigcontext(regs, &frame->rs_uc.uc_mcontext))
return -EFAULT;
if (__copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)))
return -EFAULT; return -EFAULT;
/* /*
......
...@@ -164,6 +164,12 @@ struct clk *clk_get_parent(struct clk *clk) ...@@ -164,6 +164,12 @@ struct clk *clk_get_parent(struct clk *clk)
} }
EXPORT_SYMBOL(clk_get_parent); EXPORT_SYMBOL(clk_get_parent);
int clk_set_parent(struct clk *clk, struct clk *parent)
{
return 0;
}
EXPORT_SYMBOL(clk_set_parent);
static inline u32 get_counter_resolution(void) static inline u32 get_counter_resolution(void)
{ {
u32 res; u32 res;
......
...@@ -141,7 +141,7 @@ static void falcon_gpe_enable(void) ...@@ -141,7 +141,7 @@ static void falcon_gpe_enable(void)
unsigned int freq; unsigned int freq;
unsigned int status; unsigned int status;
/* if if the clock is already enabled */ /* if the clock is already enabled */
status = sysctl_r32(SYSCTL_SYS1, SYS1_INFRAC); status = sysctl_r32(SYSCTL_SYS1, SYS1_INFRAC);
if (status & (1 << (GPPC_OFFSET + 1))) if (status & (1 << (GPPC_OFFSET + 1)))
return; return;
......
...@@ -2,12 +2,9 @@ ...@@ -2,12 +2,9 @@
# Loongson Processors' Support # Loongson Processors' Support
# #
# Only gcc >= 4.4 have Loongson specific support
cflags-$(CONFIG_CPU_LOONGSON2EF) += -Wa,--trap cflags-$(CONFIG_CPU_LOONGSON2EF) += -Wa,--trap
cflags-$(CONFIG_CPU_LOONGSON2E) += \ cflags-$(CONFIG_CPU_LOONGSON2E) += -march=loongson2e
$(call cc-option,-march=loongson2e,-march=r4600) cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f
cflags-$(CONFIG_CPU_LOONGSON2F) += \
$(call cc-option,-march=loongson2f,-march=r4600)
# #
# Some versions of binutils, not currently mainline as of 2019/02/04, support # Some versions of binutils, not currently mainline as of 2019/02/04, support
# an -mfix-loongson3-llsc flag which emits a sync prior to each ll instruction # an -mfix-loongson3-llsc flag which emits a sync prior to each ll instruction
...@@ -32,16 +29,8 @@ cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongso ...@@ -32,16 +29,8 @@ cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongso
# Enable the workarounds for Loongson2f # Enable the workarounds for Loongson2f
ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS
ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-nop,),) cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa,-mfix-loongson2f-nop
$(error only binutils >= 2.20.2 have needed option -mfix-loongson2f-nop) cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa,-mfix-loongson2f-jump
else
cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-nop
endif
ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-jump,),)
$(error only binutils >= 2.20.2 have needed option -mfix-loongson2f-jump)
else
cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-jump
endif
endif endif
# Some -march= flags enable MMI instructions, and GCC complains about that # Some -march= flags enable MMI instructions, and GCC complains about that
......
...@@ -332,7 +332,7 @@ static void co_cache_error_call_notifiers(unsigned long val) ...@@ -332,7 +332,7 @@ static void co_cache_error_call_notifiers(unsigned long val)
} }
/* /*
* Called when the the exception is recoverable * Called when the exception is recoverable
*/ */
asmlinkage void cache_parity_error_octeon_recoverable(void) asmlinkage void cache_parity_error_octeon_recoverable(void)
...@@ -341,7 +341,7 @@ asmlinkage void cache_parity_error_octeon_recoverable(void) ...@@ -341,7 +341,7 @@ asmlinkage void cache_parity_error_octeon_recoverable(void)
} }
/* /*
* Called when the the exception is not recoverable * Called when the exception is not recoverable
*/ */
asmlinkage void cache_parity_error_octeon_non_recoverable(void) asmlinkage void cache_parity_error_octeon_non_recoverable(void)
......
...@@ -49,9 +49,7 @@ obj-$(CONFIG_TANBAC_TB0287) += fixup-tb0287.o ...@@ -49,9 +49,7 @@ obj-$(CONFIG_TANBAC_TB0287) += fixup-tb0287.o
obj-$(CONFIG_TOSHIBA_JMR3927) += fixup-jmr3927.o obj-$(CONFIG_TOSHIBA_JMR3927) += fixup-jmr3927.o
obj-$(CONFIG_SOC_TX4927) += pci-tx4927.o obj-$(CONFIG_SOC_TX4927) += pci-tx4927.o
obj-$(CONFIG_SOC_TX4938) += pci-tx4938.o obj-$(CONFIG_SOC_TX4938) += pci-tx4938.o
obj-$(CONFIG_SOC_TX4939) += pci-tx4939.o
obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o
obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-rbtx4938.o
obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o
......
/*
* Toshiba rbtx4938 pci routines
* Copyright (C) 2000-2001 Toshiba Corporation
*
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
*/
#include <linux/types.h>
#include <asm/txx9/pci.h>
#include <asm/txx9/rbtx4938.h>
int rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = tx4938_pcic1_map_irq(dev, slot);
if (irq >= 0)
return irq;
irq = pin;
/* IRQ rotation */
irq--; /* 0-3 */
if (slot == TX4927_PCIC_IDSEL_AD_TO_SLOT(23)) {
/* PCI CardSlot (IDSEL=A23) */
/* PCIA => PCIA (IDSEL=A23) */
irq = (irq + 0 + slot) % 4;
} else {
/* PCI Backplane */
if (txx9_pci_option & TXX9_PCI_OPT_PICMG)
irq = (irq + 33 - slot) % 4;
else
irq = (irq + 3 + slot) % 4;
}
irq++; /* 1-4 */
switch (irq) {
case 1:
irq = RBTX4938_IRQ_IOC_PCIA;
break;
case 2:
irq = RBTX4938_IRQ_IOC_PCIB;
break;
case 3:
irq = RBTX4938_IRQ_IOC_PCIC;
break;
case 4:
irq = RBTX4938_IRQ_IOC_PCID;
break;
}
return irq;
}
...@@ -102,14 +102,12 @@ static u32 rt3883_pci_read_cfg32(struct rt3883_pci_controller *rpc, ...@@ -102,14 +102,12 @@ static u32 rt3883_pci_read_cfg32(struct rt3883_pci_controller *rpc,
unsigned func, unsigned reg) unsigned func, unsigned reg)
{ {
u32 address; u32 address;
u32 ret;
address = rt3883_pci_get_cfgaddr(bus, slot, func, reg); address = rt3883_pci_get_cfgaddr(bus, slot, func, reg);
rt3883_pci_w32(rpc, address, RT3883_PCI_REG_CFGADDR); rt3883_pci_w32(rpc, address, RT3883_PCI_REG_CFGADDR);
ret = rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
return ret; return rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
} }
static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc, static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc,
......
/*
* Based on linux/arch/mips/txx9/rbtx4939/setup.c,
* and RBTX49xx patch from CELF patch archive.
*
* Copyright 2001, 2003-2005 MontaVista Software Inc.
* Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
* (C) Copyright TOSHIBA CORPORATION 2000-2001, 2004-2007
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/tx4939.h>
int __init tx4939_report_pciclk(void)
{
int pciclk = 0;
pr_info("PCIC --%s PCICLK:",
(__raw_readq(&tx4939_ccfgptr->ccfg) & TX4939_CCFG_PCI66) ?
" PCI66" : "");
if (__raw_readq(&tx4939_ccfgptr->pcfg) & TX4939_PCFG_PCICLKEN_ALL) {
pciclk = txx9_master_clock * 20 / 6;
if (!(__raw_readq(&tx4939_ccfgptr->ccfg) & TX4939_CCFG_PCI66))
pciclk /= 2;
pr_cont("Internal(%u.%uMHz)",
(pciclk + 50000) / 1000000,
((pciclk + 50000) / 100000) % 10);
} else {
pr_cont("External");
pciclk = -1;
}
pr_cont("\n");
return pciclk;
}
void __init tx4939_report_pci1clk(void)
{
unsigned int pciclk = txx9_master_clock * 20 / 6;
pr_info("PCIC1 -- PCICLK:%u.%uMHz\n",
(pciclk + 50000) / 1000000,
((pciclk + 50000) / 100000) % 10);
}
int tx4939_pcic1_map_irq(const struct pci_dev *dev, u8 slot)
{
if (get_tx4927_pcicptr(dev->bus->sysdata) == tx4939_pcic1ptr) {
switch (slot) {
case TX4927_PCIC_IDSEL_AD_TO_SLOT(31):
if (__raw_readq(&tx4939_ccfgptr->pcfg) &
TX4939_PCFG_ET0MODE)
return TXX9_IRQ_BASE + TX4939_IR_ETH(0);
break;
case TX4927_PCIC_IDSEL_AD_TO_SLOT(30):
if (__raw_readq(&tx4939_ccfgptr->pcfg) &
TX4939_PCFG_ET1MODE)
return TXX9_IRQ_BASE + TX4939_IR_ETH(1);
break;
}
return 0;
}
return -1;
}
int tx4939_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = tx4939_pcic1_map_irq(dev, slot);
if (irq >= 0)
return irq;
irq = pin;
/* IRQ rotation */
irq--; /* 0-3 */
irq = (irq + 33 - slot) % 4;
irq++; /* 1-4 */
switch (irq) {
case 1:
irq = TXX9_IRQ_BASE + TX4939_IR_INTA;
break;
case 2:
irq = TXX9_IRQ_BASE + TX4939_IR_INTB;
break;
case 3:
irq = TXX9_IRQ_BASE + TX4939_IR_INTC;
break;
case 4:
irq = TXX9_IRQ_BASE + TX4939_IR_INTD;
break;
}
return irq;
}
void __init tx4939_setup_pcierr_irq(void)
{
if (request_irq(TXX9_IRQ_BASE + TX4939_IR_PCIERR,
tx4927_pcierr_interrupt,
0, "PCI error",
(void *)TX4939_PCIC_REG))
pr_warn("Failed to request irq for PCIERR\n");
}
...@@ -65,6 +65,7 @@ static int __init ill_acc_of_setup(void) ...@@ -65,6 +65,7 @@ static int __init ill_acc_of_setup(void)
} }
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
of_node_put(np);
if (!irq) { if (!irq) {
dev_err(&pdev->dev, "failed to get irq\n"); dev_err(&pdev->dev, "failed to get irq\n");
put_device(&pdev->dev); put_device(&pdev->dev);
......
...@@ -23,10 +23,5 @@ endif ...@@ -23,10 +23,5 @@ endif
# be 16kb aligned or the handling of the current variable will break. # be 16kb aligned or the handling of the current variable will break.
# Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys
# #
ifdef CONFIG_SGI_IP28
ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n)
$(error gcc doesn't support needed option -mr10k-cache-barrier=store)
endif
endif
cflags-$(CONFIG_SGI_IP28) += -mr10k-cache-barrier=store -I$(srctree)/arch/mips/include/asm/mach-ip28 cflags-$(CONFIG_SGI_IP28) += -mr10k-cache-barrier=store -I$(srctree)/arch/mips/include/asm/mach-ip28
load-$(CONFIG_SGI_IP28) += 0xa800000020004000 load-$(CONFIG_SGI_IP28) += 0xa800000020004000
...@@ -6,6 +6,7 @@ config MACH_TX39XX ...@@ -6,6 +6,7 @@ config MACH_TX39XX
config MACH_TX49XX config MACH_TX49XX
bool bool
select BOOT_ELF32
select MACH_TXX9 select MACH_TXX9
select CEVT_R4K select CEVT_R4K
select CSRC_R4K select CSRC_R4K
...@@ -38,23 +39,6 @@ config TOSHIBA_RBTX4927 ...@@ -38,23 +39,6 @@ config TOSHIBA_RBTX4927
This Toshiba board is based on the TX4927 processor. Say Y here to This Toshiba board is based on the TX4927 processor. Say Y here to
support this machine type support this machine type
config TOSHIBA_RBTX4938
bool "Toshiba RBTX4938 board"
depends on MACH_TX49XX
select SOC_TX4938
help
This Toshiba board is based on the TX4938 processor. Say Y here to
support this machine type
config TOSHIBA_RBTX4939
bool "Toshiba RBTX4939 board"
depends on MACH_TX49XX
select SOC_TX4939
select TXX9_7SEGLED
help
This Toshiba board is based on the TX4939 processor. Say Y here to
support this machine type
config SOC_TX3927 config SOC_TX3927
bool bool
select CEVT_TXX9 select CEVT_TXX9
...@@ -71,7 +55,6 @@ config SOC_TX4927 ...@@ -71,7 +55,6 @@ config SOC_TX4927
select IRQ_TXX9 select IRQ_TXX9
select PCI_TX4927 select PCI_TX4927
select GPIO_TXX9 select GPIO_TXX9
imply HAS_TXX9_ACLC
config SOC_TX4938 config SOC_TX4938
bool bool
...@@ -81,18 +64,6 @@ config SOC_TX4938 ...@@ -81,18 +64,6 @@ config SOC_TX4938
select IRQ_TXX9 select IRQ_TXX9
select PCI_TX4927 select PCI_TX4927
select GPIO_TXX9 select GPIO_TXX9
imply HAS_TXX9_ACLC
config SOC_TX4939
bool
select CEVT_TXX9
imply HAS_TXX9_SERIAL
select HAVE_PCI
select PCI_TX4927
imply HAS_TXX9_ACLC
config TXX9_7SEGLED
bool
config TOSHIBA_FPCIB0 config TOSHIBA_FPCIB0
bool "FPCIB0 Backplane Support" bool "FPCIB0 Backplane Support"
...@@ -104,25 +75,5 @@ config PICMG_PCI_BACKPLANE_DEFAULT ...@@ -104,25 +75,5 @@ config PICMG_PCI_BACKPLANE_DEFAULT
depends on PCI && MACH_TXX9 depends on PCI && MACH_TXX9
default y if !TOSHIBA_FPCIB0 default y if !TOSHIBA_FPCIB0
if TOSHIBA_RBTX4938
comment "Multiplex Pin Select"
choice
prompt "PIO[58:61]"
default TOSHIBA_RBTX4938_MPLEX_PIO58_61
config TOSHIBA_RBTX4938_MPLEX_PIO58_61
bool "PIO"
config TOSHIBA_RBTX4938_MPLEX_NAND
bool "NAND"
config TOSHIBA_RBTX4938_MPLEX_ATA
bool "ATA"
config TOSHIBA_RBTX4938_MPLEX_KEEP
bool "Keep firmware settings"
endchoice
endif
config PCI_TX4927 config PCI_TX4927
bool bool
...@@ -14,5 +14,3 @@ obj-$(CONFIG_TOSHIBA_JMR3927) += jmr3927/ ...@@ -14,5 +14,3 @@ obj-$(CONFIG_TOSHIBA_JMR3927) += jmr3927/
# Toshiba RBTX49XX boards # Toshiba RBTX49XX boards
# #
obj-$(CONFIG_TOSHIBA_RBTX4927) += rbtx4927/ obj-$(CONFIG_TOSHIBA_RBTX4927) += rbtx4927/
obj-$(CONFIG_TOSHIBA_RBTX4938) += rbtx4938/
obj-$(CONFIG_TOSHIBA_RBTX4939) += rbtx4939/
/*
* 7 Segment LED routines
* Based on RBTX49xx patch from CELF patch archive.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* (C) Copyright TOSHIBA CORPORATION 2005-2007
* All Rights Reserved.
*/
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/map_to_7segment.h>
#include <asm/txx9/generic.h>
static unsigned int tx_7segled_num;
static void (*tx_7segled_putc)(unsigned int pos, unsigned char val);
void __init txx9_7segled_init(unsigned int num,
void (*putc)(unsigned int pos, unsigned char val))
{
tx_7segled_num = num;
tx_7segled_putc = putc;
}
static SEG7_CONVERSION_MAP(txx9_seg7map, MAP_ASCII7SEG_ALPHANUM_LC);
int txx9_7segled_putc(unsigned int pos, char c)
{
if (pos >= tx_7segled_num)
return -EINVAL;
c = map_to_seg7(&txx9_seg7map, c);
if (c < 0)
return c;
tx_7segled_putc(pos, c);
return 0;
}
static ssize_t ascii_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
unsigned int ch = dev->id;
txx9_7segled_putc(ch, buf[0]);
return size;
}
static ssize_t raw_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
unsigned int ch = dev->id;
tx_7segled_putc(ch, buf[0]);
return size;
}
static DEVICE_ATTR_WO(ascii);
static DEVICE_ATTR_WO(raw);
static ssize_t map_seg7_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
return sizeof(txx9_seg7map);
}
static ssize_t map_seg7_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
if (size != sizeof(txx9_seg7map))
return -EINVAL;
memcpy(&txx9_seg7map, buf, size);
return size;
}
static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);
static struct bus_type tx_7segled_subsys = {
.name = "7segled",
.dev_name = "7segled",
};
static void tx_7segled_release(struct device *dev)
{
kfree(dev);
}
static int __init tx_7segled_init_sysfs(void)
{
int error, i;
if (!tx_7segled_num)
return -ENODEV;
error = subsys_system_register(&tx_7segled_subsys, NULL);
if (error)
return error;
error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7);
if (error)
return error;
for (i = 0; i < tx_7segled_num; i++) {
struct device *dev;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
error = -ENODEV;
break;
}
dev->id = i;
dev->bus = &tx_7segled_subsys;
dev->release = &tx_7segled_release;
error = device_register(dev);
if (error) {
put_device(dev);
return error;
}
device_create_file(dev, &dev_attr_ascii);
device_create_file(dev, &dev_attr_raw);
}
return error;
}
device_initcall(tx_7segled_init_sysfs);
...@@ -8,7 +8,4 @@ obj-$(CONFIG_PCI) += pci.o ...@@ -8,7 +8,4 @@ obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_SOC_TX3927) += setup_tx3927.o irq_tx3927.o obj-$(CONFIG_SOC_TX3927) += setup_tx3927.o irq_tx3927.o
obj-$(CONFIG_SOC_TX4927) += mem_tx4927.o setup_tx4927.o irq_tx4927.o obj-$(CONFIG_SOC_TX4927) += mem_tx4927.o setup_tx4927.o irq_tx4927.o
obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o
obj-$(CONFIG_SOC_TX4939) += setup_tx4939.o irq_tx4939.o
obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o
obj-$(CONFIG_SPI) += spi_eeprom.o
obj-$(CONFIG_TXX9_7SEGLED) += 7segled.o
/*
* TX4939 irq routines
* Based on linux/arch/mips/kernel/irq_txx9.c,
* and RBTX49xx patch from CELF patch archive.
*
* Copyright 2001, 2003-2005 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ahennessy@mvista.com
* source@mvista.com
* Copyright (C) 2000-2001,2005-2007 Toshiba Corporation
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
/*
* TX4939 defines 64 IRQs.
* Similer to irq_txx9.c but different register layouts.
*/
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/types.h>
#include <asm/irq_cpu.h>
#include <asm/txx9irq.h>
#include <asm/txx9/tx4939.h>
/* IRCER : Int. Control Enable */
#define TXx9_IRCER_ICE 0x00000001
/* IRCR : Int. Control */
#define TXx9_IRCR_LOW 0x00000000
#define TXx9_IRCR_HIGH 0x00000001
#define TXx9_IRCR_DOWN 0x00000002
#define TXx9_IRCR_UP 0x00000003
#define TXx9_IRCR_EDGE(cr) ((cr) & 0x00000002)
/* IRSCR : Int. Status Control */
#define TXx9_IRSCR_EIClrE 0x00000100
#define TXx9_IRSCR_EIClr_MASK 0x0000000f
/* IRCSR : Int. Current Status */
#define TXx9_IRCSR_IF 0x00010000
#define irc_dlevel 0
#define irc_elevel 1
static struct {
unsigned char level;
unsigned char mode;
} tx4939irq[TX4939_NUM_IR] __read_mostly;
static void tx4939_irq_unmask(struct irq_data *d)
{
unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
u32 __iomem *lvlp;
int ofs;
if (irq_nr < 32) {
irq_nr--;
lvlp = &tx4939_ircptr->lvl[(irq_nr % 16) / 2].r;
} else {
irq_nr -= 32;
lvlp = &tx4939_ircptr->lvl[8 + (irq_nr % 16) / 2].r;
}
ofs = (irq_nr & 16) + (irq_nr & 1) * 8;
__raw_writel((__raw_readl(lvlp) & ~(0xff << ofs))
| (tx4939irq[irq_nr].level << ofs),
lvlp);
}
static inline void tx4939_irq_mask(struct irq_data *d)
{
unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
u32 __iomem *lvlp;
int ofs;
if (irq_nr < 32) {
irq_nr--;
lvlp = &tx4939_ircptr->lvl[(irq_nr % 16) / 2].r;
} else {
irq_nr -= 32;
lvlp = &tx4939_ircptr->lvl[8 + (irq_nr % 16) / 2].r;
}
ofs = (irq_nr & 16) + (irq_nr & 1) * 8;
__raw_writel((__raw_readl(lvlp) & ~(0xff << ofs))
| (irc_dlevel << ofs),
lvlp);
mmiowb();
}
static void tx4939_irq_mask_ack(struct irq_data *d)
{
unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
tx4939_irq_mask(d);
if (TXx9_IRCR_EDGE(tx4939irq[irq_nr].mode)) {
irq_nr--;
/* clear edge detection */
__raw_writel((TXx9_IRSCR_EIClrE | (irq_nr & 0xf))
<< (irq_nr & 0x10),
&tx4939_ircptr->edc.r);
}
}
static int tx4939_irq_set_type(struct irq_data *d, unsigned int flow_type)
{
unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
u32 cr;
u32 __iomem *crp;
int ofs;
int mode;
if (flow_type & IRQF_TRIGGER_PROBE)
return 0;
switch (flow_type & IRQF_TRIGGER_MASK) {
case IRQF_TRIGGER_RISING:
mode = TXx9_IRCR_UP;
break;
case IRQF_TRIGGER_FALLING:
mode = TXx9_IRCR_DOWN;
break;
case IRQF_TRIGGER_HIGH:
mode = TXx9_IRCR_HIGH;
break;
case IRQF_TRIGGER_LOW:
mode = TXx9_IRCR_LOW;
break;
default:
return -EINVAL;
}
if (irq_nr < 32) {
irq_nr--;
crp = &tx4939_ircptr->dm[(irq_nr & 8) >> 3].r;
} else {
irq_nr -= 32;
crp = &tx4939_ircptr->dm2[((irq_nr & 8) >> 3)].r;
}
ofs = (((irq_nr & 16) >> 1) | (irq_nr & (8 - 1))) * 2;
cr = __raw_readl(crp);
cr &= ~(0x3 << ofs);
cr |= (mode & 0x3) << ofs;
__raw_writel(cr, crp);
tx4939irq[irq_nr].mode = mode;
return 0;
}
static struct irq_chip tx4939_irq_chip = {
.name = "TX4939",
.irq_ack = tx4939_irq_mask_ack,
.irq_mask = tx4939_irq_mask,
.irq_mask_ack = tx4939_irq_mask_ack,
.irq_unmask = tx4939_irq_unmask,
.irq_set_type = tx4939_irq_set_type,
};
static int tx4939_irq_set_pri(int irc_irq, int new_pri)
{
int old_pri;
if ((unsigned int)irc_irq >= TX4939_NUM_IR)
return 0;
old_pri = tx4939irq[irc_irq].level;
tx4939irq[irc_irq].level = new_pri;
return old_pri;
}
void __init tx4939_irq_init(void)
{
int i;
mips_cpu_irq_init();
/* disable interrupt control */
__raw_writel(0, &tx4939_ircptr->den.r);
__raw_writel(0, &tx4939_ircptr->maskint.r);
__raw_writel(0, &tx4939_ircptr->maskext.r);
/* irq_base + 0 is not used */
for (i = 1; i < TX4939_NUM_IR; i++) {
tx4939irq[i].level = 4; /* middle level */
tx4939irq[i].mode = TXx9_IRCR_LOW;
irq_set_chip_and_handler(TXX9_IRQ_BASE + i, &tx4939_irq_chip,
handle_level_irq);
}
/* mask all IRC interrupts */
__raw_writel(0, &tx4939_ircptr->msk.r);
for (i = 0; i < 16; i++)
__raw_writel(0, &tx4939_ircptr->lvl[i].r);
/* setup IRC interrupt mode (Low Active) */
for (i = 0; i < 2; i++)
__raw_writel(0, &tx4939_ircptr->dm[i].r);
for (i = 0; i < 2; i++)
__raw_writel(0, &tx4939_ircptr->dm2[i].r);
/* enable interrupt control */
__raw_writel(TXx9_IRCER_ICE, &tx4939_ircptr->den.r);
__raw_writel(irc_elevel, &tx4939_ircptr->msk.r);
irq_set_chained_handler(MIPS_CPU_IRQ_BASE + TX4939_IRC_INT,
handle_simple_irq);
/* raise priority for errors, timers, sio */
tx4939_irq_set_pri(TX4939_IR_WTOERR, 7);
tx4939_irq_set_pri(TX4939_IR_PCIERR, 7);
tx4939_irq_set_pri(TX4939_IR_PCIPME, 7);
for (i = 0; i < TX4939_NUM_IR_TMR; i++)
tx4939_irq_set_pri(TX4939_IR_TMR(i), 6);
for (i = 0; i < TX4939_NUM_IR_SIO; i++)
tx4939_irq_set_pri(TX4939_IR_SIO(i), 5);
}
int tx4939_irq(void)
{
u32 csr = __raw_readl(&tx4939_ircptr->cs.r);
if (likely(!(csr & TXx9_IRCSR_IF)))
return TXX9_IRQ_BASE + (csr & (TX4939_NUM_IR - 1));
return -1;
}
...@@ -314,16 +314,6 @@ static void __init select_board(void) ...@@ -314,16 +314,6 @@ static void __init select_board(void)
case 0x4937: case 0x4937:
txx9_board_vec = &rbtx4937_vec; txx9_board_vec = &rbtx4937_vec;
break; break;
#endif
#ifdef CONFIG_TOSHIBA_RBTX4938
case 0x4938:
txx9_board_vec = &rbtx4938_vec;
break;
#endif
#ifdef CONFIG_TOSHIBA_RBTX4939
case 0x4939:
txx9_board_vec = &rbtx4939_vec;
break;
#endif #endif
} }
#endif #endif
...@@ -590,21 +580,6 @@ unsigned long (*__swizzle_addr_b)(unsigned long port) = __swizzle_addr_none; ...@@ -590,21 +580,6 @@ unsigned long (*__swizzle_addr_b)(unsigned long port) = __swizzle_addr_none;
EXPORT_SYMBOL(__swizzle_addr_b); EXPORT_SYMBOL(__swizzle_addr_b);
#endif #endif
#ifdef NEEDS_TXX9_IOSWABW
static u16 ioswabw_default(volatile u16 *a, u16 x)
{
return le16_to_cpu(x);
}
static u16 __mem_ioswabw_default(volatile u16 *a, u16 x)
{
return x;
}
u16 (*ioswabw)(volatile u16 *a, u16 x) = ioswabw_default;
EXPORT_SYMBOL(ioswabw);
u16 (*__mem_ioswabw)(volatile u16 *a, u16 x) = __mem_ioswabw_default;
EXPORT_SYMBOL(__mem_ioswabw);
#endif
void __init txx9_physmap_flash_init(int no, unsigned long addr, void __init txx9_physmap_flash_init(int no, unsigned long addr,
unsigned long size, unsigned long size,
const struct physmap_flash_data *pdata) const struct physmap_flash_data *pdata)
...@@ -840,34 +815,6 @@ void __init txx9_aclc_init(unsigned long baseaddr, int irq, ...@@ -840,34 +815,6 @@ void __init txx9_aclc_init(unsigned long baseaddr, int irq,
unsigned int dma_chan_out, unsigned int dma_chan_out,
unsigned int dma_chan_in) unsigned int dma_chan_in)
{ {
#if IS_ENABLED(CONFIG_SND_SOC_TXX9ACLC)
unsigned int dma_base = dmac_id * TXX9_DMA_MAX_NR_CHANNELS;
struct resource res[] = {
{
.start = baseaddr,
.end = baseaddr + 0x100 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = irq,
.flags = IORESOURCE_IRQ,
}, {
.name = "txx9dmac-chan",
.start = dma_base + dma_chan_out,
.flags = IORESOURCE_DMA,
}, {
.name = "txx9dmac-chan",
.start = dma_base + dma_chan_in,
.flags = IORESOURCE_DMA,
}
};
struct platform_device *pdev =
platform_device_alloc("txx9aclc-ac97", -1);
if (!pdev ||
platform_device_add_resources(pdev, res, ARRAY_SIZE(res)) ||
platform_device_add(pdev))
platform_device_put(pdev);
#endif
} }
static struct bus_type txx9_sramc_subsys = { static struct bus_type txx9_sramc_subsys = {
......
This diff is collapsed.
/*
* spi_eeprom.c
* Copyright (C) 2000-2001 Toshiba Corporation
*
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
*/
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/device.h>
#include <linux/spi/spi.h>
#include <linux/spi/eeprom.h>
#include <asm/txx9/spi.h>
#define AT250X0_PAGE_SIZE 8
/* register board information for at25 driver */
int __init spi_eeprom_register(int busid, int chipid, int size)
{
struct spi_board_info info = {
.modalias = "at25",
.max_speed_hz = 1500000, /* 1.5Mbps */
.bus_num = busid,
.chip_select = chipid,
/* Mode 0: High-Active, Sample-Then-Shift */
};
struct spi_eeprom *eeprom;
eeprom = kzalloc(sizeof(*eeprom), GFP_KERNEL);
if (!eeprom)
return -ENOMEM;
strcpy(eeprom->name, "at250x0");
eeprom->byte_len = size;
eeprom->page_size = AT250X0_PAGE_SIZE;
eeprom->flags = EE_ADDR1;
info.platform_data = eeprom;
return spi_register_board_info(&info, 1);
}
/* simple temporary spi driver to provide early access to seeprom. */
static struct read_param {
int busid;
int chipid;
int address;
unsigned char *buf;
int len;
} *read_param;
static int __init early_seeprom_probe(struct spi_device *spi)
{
int stat = 0;
u8 cmd[2];
int len = read_param->len;
char *buf = read_param->buf;
int address = read_param->address;
dev_info(&spi->dev, "spiclk %u KHz.\n",
(spi->max_speed_hz + 500) / 1000);
if (read_param->busid != spi->master->bus_num ||
read_param->chipid != spi->chip_select)
return -ENODEV;
while (len > 0) {
/* spi_write_then_read can only work with small chunk */
int c = len < AT250X0_PAGE_SIZE ? len : AT250X0_PAGE_SIZE;
cmd[0] = 0x03; /* AT25_READ */
cmd[1] = address;
stat = spi_write_then_read(spi, cmd, sizeof(cmd), buf, c);
buf += c;
len -= c;
address += c;
}
return stat;
}
static struct spi_driver early_seeprom_driver __initdata = {
.driver = {
.name = "at25",
},
.probe = early_seeprom_probe,
};
int __init spi_eeprom_read(int busid, int chipid, int address,
unsigned char *buf, int len)
{
int ret;
struct read_param param = {
.busid = busid,
.chipid = chipid,
.address = address,
.buf = buf,
.len = len
};
read_param = &param;
ret = spi_register_driver(&early_seeprom_driver);
if (!ret)
spi_unregister_driver(&early_seeprom_driver);
return ret;
}
# SPDX-License-Identifier: GPL-2.0-only
obj-y += prom.o setup.o irq.o
/*
* Toshiba RBTX4938 specific interrupt handlers
* Copyright (C) 2000-2001 Toshiba Corporation
*
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
*/
/*
* MIPS_CPU_IRQ_BASE+00 Software 0
* MIPS_CPU_IRQ_BASE+01 Software 1
* MIPS_CPU_IRQ_BASE+02 Cascade TX4938-CP0
* MIPS_CPU_IRQ_BASE+03 Multiplexed -- do not use
* MIPS_CPU_IRQ_BASE+04 Multiplexed -- do not use
* MIPS_CPU_IRQ_BASE+05 Multiplexed -- do not use
* MIPS_CPU_IRQ_BASE+06 Multiplexed -- do not use
* MIPS_CPU_IRQ_BASE+07 CPU TIMER
*
* TXX9_IRQ_BASE+00
* TXX9_IRQ_BASE+01
* TXX9_IRQ_BASE+02 Cascade RBTX4938-IOC
* TXX9_IRQ_BASE+03 RBTX4938 RTL-8019AS Ethernet
* TXX9_IRQ_BASE+04
* TXX9_IRQ_BASE+05 TX4938 ETH1
* TXX9_IRQ_BASE+06 TX4938 ETH0
* TXX9_IRQ_BASE+07
* TXX9_IRQ_BASE+08 TX4938 SIO 0
* TXX9_IRQ_BASE+09 TX4938 SIO 1
* TXX9_IRQ_BASE+10 TX4938 DMA0
* TXX9_IRQ_BASE+11 TX4938 DMA1
* TXX9_IRQ_BASE+12 TX4938 DMA2
* TXX9_IRQ_BASE+13 TX4938 DMA3
* TXX9_IRQ_BASE+14
* TXX9_IRQ_BASE+15
* TXX9_IRQ_BASE+16 TX4938 PCIC
* TXX9_IRQ_BASE+17 TX4938 TMR0
* TXX9_IRQ_BASE+18 TX4938 TMR1
* TXX9_IRQ_BASE+19 TX4938 TMR2
* TXX9_IRQ_BASE+20
* TXX9_IRQ_BASE+21
* TXX9_IRQ_BASE+22 TX4938 PCIERR
* TXX9_IRQ_BASE+23
* TXX9_IRQ_BASE+24
* TXX9_IRQ_BASE+25
* TXX9_IRQ_BASE+26
* TXX9_IRQ_BASE+27
* TXX9_IRQ_BASE+28
* TXX9_IRQ_BASE+29
* TXX9_IRQ_BASE+30
* TXX9_IRQ_BASE+31 TX4938 SPI
*
* RBTX4938_IRQ_IOC+00 PCI-D
* RBTX4938_IRQ_IOC+01 PCI-C
* RBTX4938_IRQ_IOC+02 PCI-B
* RBTX4938_IRQ_IOC+03 PCI-A
* RBTX4938_IRQ_IOC+04 RTC
* RBTX4938_IRQ_IOC+05 ATA
* RBTX4938_IRQ_IOC+06 MODEM
* RBTX4938_IRQ_IOC+07 SWINT
*/
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <asm/mipsregs.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/rbtx4938.h>
static int toshiba_rbtx4938_irq_nested(int sw_irq)
{
u8 level3;
level3 = readb(rbtx4938_imstat_addr);
if (unlikely(!level3))
return -1;
/* must use fls so onboard ATA has priority */
return RBTX4938_IRQ_IOC + __fls8(level3);
}
static void toshiba_rbtx4938_irq_ioc_enable(struct irq_data *d)
{
unsigned char v;
v = readb(rbtx4938_imask_addr);
v |= (1 << (d->irq - RBTX4938_IRQ_IOC));
writeb(v, rbtx4938_imask_addr);
mmiowb();
}
static void toshiba_rbtx4938_irq_ioc_disable(struct irq_data *d)
{
unsigned char v;
v = readb(rbtx4938_imask_addr);
v &= ~(1 << (d->irq - RBTX4938_IRQ_IOC));
writeb(v, rbtx4938_imask_addr);
mmiowb();
}
#define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC"
static struct irq_chip toshiba_rbtx4938_irq_ioc_type = {
.name = TOSHIBA_RBTX4938_IOC_NAME,
.irq_mask = toshiba_rbtx4938_irq_ioc_disable,
.irq_unmask = toshiba_rbtx4938_irq_ioc_enable,
};
static int rbtx4938_irq_dispatch(int pending)
{
int irq;
if (pending & STATUSF_IP7)
irq = MIPS_CPU_IRQ_BASE + 7;
else if (pending & STATUSF_IP2) {
irq = txx9_irq();
if (irq == RBTX4938_IRQ_IOCINT)
irq = toshiba_rbtx4938_irq_nested(irq);
} else if (pending & STATUSF_IP1)
irq = MIPS_CPU_IRQ_BASE + 0;
else if (pending & STATUSF_IP0)
irq = MIPS_CPU_IRQ_BASE + 1;
else
irq = -1;
return irq;
}
static void __init toshiba_rbtx4938_irq_ioc_init(void)
{
int i;
for (i = RBTX4938_IRQ_IOC;
i < RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC; i++)
irq_set_chip_and_handler(i, &toshiba_rbtx4938_irq_ioc_type,
handle_level_irq);
irq_set_chained_handler(RBTX4938_IRQ_IOCINT, handle_simple_irq);
}
void __init rbtx4938_irq_setup(void)
{
txx9_irq_dispatch = rbtx4938_irq_dispatch;
/* Now, interrupt control disabled, */
/* all IRC interrupts are masked, */
/* all IRC interrupt mode are Low Active. */
/* mask all IOC interrupts */
writeb(0, rbtx4938_imask_addr);
/* clear SoftInt interrupts */
writeb(0, rbtx4938_softint_addr);
tx4938_irq_init();
toshiba_rbtx4938_irq_ioc_init();
/* Onboard 10M Ether: High Active */
irq_set_irq_type(RBTX4938_IRQ_ETHER, IRQF_TRIGGER_HIGH);
}
/*
* rbtx4938 specific prom routines
* Copyright (C) 2000-2001 Toshiba Corporation
*
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
*/
#include <linux/init.h>
#include <linux/memblock.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/rbtx4938.h>
void __init rbtx4938_prom_init(void)
{
memblock_add(0, tx4938_get_mem_size());
txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL);
}
This diff is collapsed.
# SPDX-License-Identifier: GPL-2.0-only
obj-y += irq.o setup.o prom.o
/*
* Toshiba RBTX4939 interrupt routines
* Based on linux/arch/mips/txx9/rbtx4938/irq.c,
* and RBTX49xx patch from CELF patch archive.
*
* Copyright (C) 2000-2001,2005-2006 Toshiba Corporation
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is
* licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <asm/mipsregs.h>
#include <asm/txx9/rbtx4939.h>
/*
* RBTX4939 IOC controller definition
*/
static void rbtx4939_ioc_irq_unmask(struct irq_data *d)
{
int ioc_nr = d->irq - RBTX4939_IRQ_IOC;
writeb(readb(rbtx4939_ien_addr) | (1 << ioc_nr), rbtx4939_ien_addr);
}
static void rbtx4939_ioc_irq_mask(struct irq_data *d)
{
int ioc_nr = d->irq - RBTX4939_IRQ_IOC;
writeb(readb(rbtx4939_ien_addr) & ~(1 << ioc_nr), rbtx4939_ien_addr);
mmiowb();
}
static struct irq_chip rbtx4939_ioc_irq_chip = {
.name = "IOC",
.irq_mask = rbtx4939_ioc_irq_mask,
.irq_unmask = rbtx4939_ioc_irq_unmask,
};
static inline int rbtx4939_ioc_irqroute(void)
{
unsigned char istat = readb(rbtx4939_ifac2_addr);
if (unlikely(istat == 0))
return -1;
return RBTX4939_IRQ_IOC + __fls8(istat);
}
static int rbtx4939_irq_dispatch(int pending)
{
int irq;
if (pending & CAUSEF_IP7)
return MIPS_CPU_IRQ_BASE + 7;
irq = tx4939_irq();
if (likely(irq >= 0)) {
/* redirect IOC interrupts */
switch (irq) {
case RBTX4939_IRQ_IOCINT:
irq = rbtx4939_ioc_irqroute();
break;
}
} else if (pending & CAUSEF_IP0)
irq = MIPS_CPU_IRQ_BASE + 0;
else if (pending & CAUSEF_IP1)
irq = MIPS_CPU_IRQ_BASE + 1;
else
irq = -1;
return irq;
}
void __init rbtx4939_irq_setup(void)
{
int i;
/* mask all IOC interrupts */
writeb(0, rbtx4939_ien_addr);
/* clear SoftInt interrupts */
writeb(0, rbtx4939_softint_addr);
txx9_irq_dispatch = rbtx4939_irq_dispatch;
tx4939_irq_init();
for (i = RBTX4939_IRQ_IOC;
i < RBTX4939_IRQ_IOC + RBTX4939_NR_IRQ_IOC; i++)
irq_set_chip_and_handler(i, &rbtx4939_ioc_irq_chip,
handle_level_irq);
irq_set_chained_handler(RBTX4939_IRQ_IOCINT, handle_simple_irq);
}
/*
* rbtx4939 specific prom routines
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/memblock.h>
#include <asm/txx9/generic.h>
#include <asm/txx9/rbtx4939.h>
void __init rbtx4939_prom_init(void)
{
unsigned long start, size;
u64 win;
int i;
for (i = 0; i < 4; i++) {
if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i)))
continue;
win = ____raw_readq(&tx4939_ddrcptr->win[i]);
start = (unsigned long)(win >> 48);
size = (((unsigned long)(win >> 32) & 0xffff) + 1) - start;
memblock_add(start << 20, size << 20);
}
txx9_sio_putchar_init(TX4939_SIO_REG(0) & 0xfffffffffULL);
}
This diff is collapsed.
...@@ -226,19 +226,6 @@ config HW_RANDOM_VIRTIO ...@@ -226,19 +226,6 @@ config HW_RANDOM_VIRTIO
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called virtio-rng. If unsure, say N. module will be called virtio-rng. If unsure, say N.
config HW_RANDOM_TX4939
tristate "TX4939 Random Number Generator support"
depends on SOC_TX4939
default HW_RANDOM
help
This driver provides kernel-side support for the Random Number
Generator hardware found on TX4939 SoC.
To compile this driver as a module, choose M here: the
module will be called tx4939-rng.
If unsure, say Y.
config HW_RANDOM_MXC_RNGA config HW_RANDOM_MXC_RNGA
tristate "Freescale i.MX RNGA Random Number Generator" tristate "Freescale i.MX RNGA Random Number Generator"
depends on SOC_IMX31 depends on SOC_IMX31
......
...@@ -20,7 +20,6 @@ obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o ...@@ -20,7 +20,6 @@ obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o
obj-$(CONFIG_HW_RANDOM_OMAP3_ROM) += omap3-rom-rng.o obj-$(CONFIG_HW_RANDOM_OMAP3_ROM) += omap3-rom-rng.o
obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o
obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o
obj-$(CONFIG_HW_RANDOM_TX4939) += tx4939-rng.o
obj-$(CONFIG_HW_RANDOM_MXC_RNGA) += mxc-rnga.o obj-$(CONFIG_HW_RANDOM_MXC_RNGA) += mxc-rnga.o
obj-$(CONFIG_HW_RANDOM_IMX_RNGC) += imx-rngc.o obj-$(CONFIG_HW_RANDOM_IMX_RNGC) += imx-rngc.o
obj-$(CONFIG_HW_RANDOM_INGENIC_RNG) += ingenic-rng.o obj-$(CONFIG_HW_RANDOM_INGENIC_RNG) += ingenic-rng.o
......
This diff is collapsed.
...@@ -357,12 +357,6 @@ config MTD_INTEL_VR_NOR ...@@ -357,12 +357,6 @@ config MTD_INTEL_VR_NOR
Map driver for a NOR flash bank located on the Expansion Bus of the Map driver for a NOR flash bank located on the Expansion Bus of the
Intel Vermilion Range chipset. Intel Vermilion Range chipset.
config MTD_RBTX4939
tristate "Map driver for RBTX4939 board"
depends on TOSHIBA_RBTX4939 && MTD_CFI && MTD_COMPLEX_MAPPINGS
help
Map driver for NOR flash chips on RBTX4939 board.
config MTD_PLATRAM config MTD_PLATRAM
tristate "Map driver for platform device RAM (mtd-ram)" tristate "Map driver for platform device RAM (mtd-ram)"
select MTD_RAM select MTD_RAM
......
...@@ -42,6 +42,5 @@ obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o ...@@ -42,6 +42,5 @@ obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
obj-$(CONFIG_MTD_IXP4XX) += ixp4xx.o obj-$(CONFIG_MTD_IXP4XX) += ixp4xx.o
obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o
obj-$(CONFIG_MTD_VMU) += vmu-flash.o obj-$(CONFIG_MTD_VMU) += vmu-flash.o
obj-$(CONFIG_MTD_LANTIQ) += lantiq-flash.o obj-$(CONFIG_MTD_LANTIQ) += lantiq-flash.o
This diff is collapsed.
...@@ -309,7 +309,7 @@ config MTD_NAND_DAVINCI ...@@ -309,7 +309,7 @@ config MTD_NAND_DAVINCI
config MTD_NAND_TXX9NDFMC config MTD_NAND_TXX9NDFMC
tristate "TXx9 NAND controller" tristate "TXx9 NAND controller"
depends on SOC_TX4938 || SOC_TX4939 || COMPILE_TEST depends on SOC_TX4938 || COMPILE_TEST
depends on HAS_IOMEM depends on HAS_IOMEM
help help
This enables the NAND flash controller on the TXx9 SoCs. This enables the NAND flash controller on the TXx9 SoCs.
......
...@@ -274,7 +274,7 @@ config PCIE_BRCMSTB ...@@ -274,7 +274,7 @@ config PCIE_BRCMSTB
BMIPS_GENERIC || COMPILE_TEST BMIPS_GENERIC || COMPILE_TEST
depends on OF depends on OF
depends on PCI_MSI_IRQ_DOMAIN depends on PCI_MSI_IRQ_DOMAIN
default ARCH_BRCMSTB default ARCH_BRCMSTB || BMIPS_GENERIC
help help
Say Y here to enable PCIe host controller support for Say Y here to enable PCIe host controller support for
Broadcom STB based SoCs, like the Raspberry Pi 4. Broadcom STB based SoCs, like the Raspberry Pi 4.
......
This diff is collapsed.
This diff is collapsed.
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_CPU_HWMON) += cpu_hwmon.o obj-$(CONFIG_CPU_HWMON) += cpu_hwmon.o
obj-$(CONFIG_RS780E_ACPI) += rs780e-acpi.o obj-$(CONFIG_RS780E_ACPI) += rs780e-acpi.o
obj-$(CONFIG_LS2K_RESET) += ls2k-reset.o
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment