Skip to content

Commit

Permalink
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

Pull x86 platform changes from Ingo Molnar:

 - Support for the Technologic Systems TS-5500 platform, by Vivien
   Didelot

 - Improved NUMA support on AMD systems:

   Add support for federated systems where multiple memory controllers
   can exist and see each other over multiple PCI domains.  This
   basically means that AMD node ids can be more than 8 now and the code
   handling this is taught to incorporate PCI domain into those IDs.

 - Support for the Goldfish virtual Android emulator, by Jun Nakajima,
   Intel, Google, et al.

 - Misc fixlets.

* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Add TS-5500 platform support
  x86/srat: Simplify memory affinity init error handling
  x86/apb/timer: Remove unnecessary "if"
  goldfish: platform device for x86
  amd64_edac: Fix type usage in NB IDs and memory ranges
  amd64_edac: Fix PCI function lookup
  x86, AMD, NB: Use u16 for northbridge IDs in amd_get_nb_id
  x86, AMD, NB: Add multi-domain support
  • Loading branch information
Linus Torvalds committed Feb 20, 2013
2 parents 29d5052 + 7d02912 commit f98982c
Show file tree
Hide file tree
Showing 15 changed files with 563 additions and 79 deletions.
47 changes: 47 additions & 0 deletions Documentation/ABI/testing/sysfs-platform-ts5500
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
What: /sys/devices/platform/ts5500/adc
Date: January 2013
KernelVersion: 3.7
Contact: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
Description:
Indicates the presence of an A/D Converter. If it is present,
it will display "1", otherwise "0".

What: /sys/devices/platform/ts5500/ereset
Date: January 2013
KernelVersion: 3.7
Contact: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
Description:
Indicates the presence of an external reset. If it is present,
it will display "1", otherwise "0".

What: /sys/devices/platform/ts5500/id
Date: January 2013
KernelVersion: 3.7
Contact: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
Description:
Product ID of the TS board. TS-5500 ID is 0x60.

What: /sys/devices/platform/ts5500/jumpers
Date: January 2013
KernelVersion: 3.7
Contact: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
Description:
Bitfield showing the jumpers' state. If a jumper is present,
the corresponding bit is set. For instance, 0x0e means jumpers
2, 3 and 4 are set.

What: /sys/devices/platform/ts5500/rs485
Date: January 2013
KernelVersion: 3.7
Contact: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
Description:
Indicates the presence of the RS485 option. If it is present,
it will display "1", otherwise "0".

What: /sys/devices/platform/ts5500/sram
Date: January 2013
KernelVersion: 3.7
Contact: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
Description:
Indicates the presence of the SRAM option. If it is present,
it will display "1", otherwise "0".
5 changes: 5 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7533,6 +7533,11 @@ F: drivers/net/team/
F: include/linux/if_team.h
F: include/uapi/linux/if_team.h

TECHNOLOGIC SYSTEMS TS-5500 PLATFORM SUPPORT
M: Savoir-faire Linux Inc. <kernel@savoirfairelinux.com>
S: Maintained
F: arch/x86/platform/ts5500/

TECHNOTREND USB IR RECEIVER
M: Sean Young <sean@mess.org>
L: linux-media@vger.kernel.org
Expand Down
21 changes: 21 additions & 0 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ config X86_BIGSMP
---help---
This option is needed for the systems that have more than 8 CPUs

config GOLDFISH
def_bool y
depends on X86_GOLDFISH

if X86_32
config X86_EXTENDED_PLATFORM
bool "Support for extended (non-PC) x86 platforms"
Expand Down Expand Up @@ -405,6 +409,14 @@ config X86_UV
# Following is an alphabetically sorted list of 32 bit extended platforms
# Please maintain the alphabetic order if and when there are additions

config X86_GOLDFISH
bool "Goldfish (Virtual Platform)"
depends on X86_32
---help---
Enable support for the Goldfish virtual platform used primarily
for Android development. Unless you are building for the Android
Goldfish emulator say N here.

config X86_INTEL_CE
bool "CE4100 TV platform"
depends on PCI
Expand Down Expand Up @@ -2191,6 +2203,15 @@ config GEOS
---help---
This option enables system support for the Traverse Technologies GEOS.

config TS5500
bool "Technologic Systems TS-5500 platform support"
depends on MELAN
select CHECK_SIGNATURE
select NEW_LEDS
select LEDS_CLASS
---help---
This option enables system support for the Technologic Systems TS-5500.

endif # X86_32

config AMD_NB
Expand Down
17 changes: 17 additions & 0 deletions arch/x86/include/asm/amd_nb.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ static inline struct amd_northbridge *node_to_amd_nb(int node)
return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
}

static inline u16 amd_get_node_id(struct pci_dev *pdev)
{
struct pci_dev *misc;
int i;

for (i = 0; i != amd_nb_num(); i++) {
misc = node_to_amd_nb(i)->misc;

if (pci_domain_nr(misc->bus) == pci_domain_nr(pdev->bus) &&
PCI_SLOT(misc->devfn) == PCI_SLOT(pdev->devfn))
return i;
}

WARN(1, "Unable to find AMD Northbridge id for %s\n", pci_name(pdev));
return 0;
}

#else

#define amd_nb_num(x) 0
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
extern int get_tsc_mode(unsigned long adr);
extern int set_tsc_mode(unsigned int val);

extern int amd_get_nb_id(int cpu);
extern u16 amd_get_nb_id(int cpu);

struct aperfmperf {
u64 aperf, mperf;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/apb_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int apbt_cpuhp_notify(struct notifier_block *n,
dw_apb_clockevent_pause(adev->timer);
if (system_state == SYSTEM_RUNNING) {
pr_debug("skipping APBT CPU %lu offline\n", cpu);
} else if (adev) {
} else {
pr_debug("APBT clockevent for cpu %lu offline\n", cpu);
dw_apb_clockevent_stop(adev->timer);
}
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
#endif
}

int amd_get_nb_id(int cpu)
u16 amd_get_nb_id(int cpu)
{
int id = 0;
u16 id = 0;
#ifdef CONFIG_SMP
id = per_cpu(cpu_llc_id, cpu);
#endif
Expand Down
29 changes: 15 additions & 14 deletions arch/x86/mm/srat.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,39 +149,40 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
int node, pxm;

if (srat_disabled())
return -1;
if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
bad_srat();
return -1;
}
goto out_err;
if (ma->header.length != sizeof(struct acpi_srat_mem_affinity))
goto out_err_bad_srat;
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
return -1;

goto out_err;
if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
return -1;
goto out_err;

start = ma->base_address;
end = start + ma->length;
pxm = ma->proximity_domain;
if (acpi_srat_revision <= 1)
pxm &= 0xff;

node = setup_node(pxm);
if (node < 0) {
printk(KERN_ERR "SRAT: Too many proximity domains.\n");
bad_srat();
return -1;
goto out_err_bad_srat;
}

if (numa_add_memblk(node, start, end) < 0) {
bad_srat();
return -1;
}
if (numa_add_memblk(node, start, end) < 0)
goto out_err_bad_srat;

node_set(node, numa_nodes_parsed);

printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n",
node, pxm,
(unsigned long long) start, (unsigned long long) end - 1);

return 0;
out_err_bad_srat:
bad_srat();
out_err:
return -1;
}

void __init acpi_numa_arch_fixup(void) {}
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/platform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
obj-y += ce4100/
obj-y += efi/
obj-y += geode/
obj-y += goldfish/
obj-y += iris/
obj-y += mrst/
obj-y += olpc/
obj-y += scx200/
obj-y += sfi/
obj-y += ts5500/
obj-y += visws/
obj-y += uv/
1 change: 1 addition & 0 deletions arch/x86/platform/goldfish/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_GOLDFISH) += goldfish.o
51 changes: 51 additions & 0 deletions arch/x86/platform/goldfish/goldfish.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (C) 2011 Intel, Inc.
* Copyright (C) 2013 Intel, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/

#include <linux/kernel.h>
#include <linux/irq.h>
#include <linux/platform_device.h>

/*
* Where in virtual device memory the IO devices (timers, system controllers
* and so on)
*/

#define GOLDFISH_PDEV_BUS_BASE (0xff001000)
#define GOLDFISH_PDEV_BUS_END (0xff7fffff)
#define GOLDFISH_PDEV_BUS_IRQ (4)

#define GOLDFISH_TTY_BASE (0x2000)

static struct resource goldfish_pdev_bus_resources[] = {
{
.start = GOLDFISH_PDEV_BUS_BASE,
.end = GOLDFISH_PDEV_BUS_END,
.flags = IORESOURCE_MEM,
},
{
.start = GOLDFISH_PDEV_BUS_IRQ,
.end = GOLDFISH_PDEV_BUS_IRQ,
.flags = IORESOURCE_IRQ,
}
};

static int __init goldfish_init(void)
{
platform_device_register_simple("goldfish_pdev_bus", -1,
goldfish_pdev_bus_resources, 2);
return 0;
}
device_initcall(goldfish_init);
1 change: 1 addition & 0 deletions arch/x86/platform/ts5500/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_TS5500) += ts5500.o
Loading

0 comments on commit f98982c

Please sign in to comment.