Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Update defconfig.
  [SPARC64]: Don't double-export synchronize_irq.
  [SPARC64]: Move over to GENERIC_HARDIRQS.
  [SPARC64]: Virtualize IRQ numbers.
  [SPARC64]: Kill ino_bucket->pil
  [SPARC]: Kill __irq_itoa().
  [SPARC64]: bp->pil can never be zero
  [SPARC64]: Send all device interrupts via one PIL.
  [SPARC]: Fix iommu_flush_iotlb end address
  [SPARC]: Mark smp init functions as cpuinit
  [SPARC]: Add missing rw can_lock macros
  [SPARC]: Setup cpu_possible_map
  [SPARC]: Add topology_init()
  • Loading branch information
Linus Torvalds committed Jun 21, 2006
2 parents 077e989 + 4c5eb38 commit be883da
Show file tree
Hide file tree
Showing 59 changed files with 591 additions and 1,425 deletions.
8 changes: 0 additions & 8 deletions arch/sparc/kernel/pcic.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,13 +896,6 @@ static inline unsigned long get_irqmask(int irq_nr)
return 1 << irq_nr;
}

static inline char *pcic_irq_itoa(unsigned int irq)
{
static char buff[16];
sprintf(buff, "%d", irq);
return buff;
}

static void pcic_disable_irq(unsigned int irq_nr)
{
unsigned long mask, flags;
Expand Down Expand Up @@ -955,7 +948,6 @@ void __init sun4m_pci_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, pcic_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, pcic_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, pcic_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, pcic_irq_itoa, BTFIXUPCALL_NORM);
}

int pcibios_assign_resource(struct pci_dev *pdev, int resource)
Expand Down
34 changes: 33 additions & 1 deletion arch/sparc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/console.h>
#include <linux/spinlock.h>
#include <linux/root_dev.h>
#include <linux/cpu.h>

#include <asm/system.h>
#include <asm/io.h>
Expand Down Expand Up @@ -348,6 +349,8 @@ void __init setup_arch(char **cmdline_p)
init_mm.context = (unsigned long) NO_CONTEXT;
init_task.thread.kregs = &fake_swapper_regs;

smp_setup_cpu_possible_map();

paging_init();
}

Expand Down Expand Up @@ -389,6 +392,8 @@ console_initcall(set_preferred_console);
extern char *sparc_cpu_type;
extern char *sparc_fpu_type;

static int ncpus_probed;

static int show_cpuinfo(struct seq_file *m, void *__unused)
{
seq_printf(m,
Expand All @@ -411,7 +416,7 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
romvec->pv_printrev >> 16,
romvec->pv_printrev & 0xffff,
&cputypval,
num_possible_cpus(),
ncpus_probed,
num_online_cpus()
#ifndef CONFIG_SMP
, cpu_data(0).udelay_val/(500000/HZ),
Expand Down Expand Up @@ -471,3 +476,30 @@ void sun_do_break(void)

int serial_console = -1;
int stop_a_enabled = 1;

static int __init topology_init(void)
{
int i, ncpus, err;

/* Count the number of physically present processors in
* the machine, even on uniprocessor, so that /proc/cpuinfo
* output is consistent with 2.4.x
*/
ncpus = 0;
while (!cpu_find_by_instance(ncpus, NULL, NULL))
ncpus++;
ncpus_probed = ncpus;

err = 0;
for_each_online_cpu(i) {
struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p)
err = -ENOMEM;
else
register_cpu(p, i, NULL);
}

return err;
}

subsys_initcall(topology_init);
36 changes: 25 additions & 11 deletions arch/sparc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cpumask_t smp_commenced_mask = CPU_MASK_NONE;
/* Used to make bitops atomic */
unsigned char bitops_spinlock = 0;

void __init smp_store_cpu_info(int id)
void __cpuinit smp_store_cpu_info(int id)
{
int cpu_node;

Expand Down Expand Up @@ -267,30 +267,44 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus)
{
extern void smp4m_boot_cpus(void);
int i, cpuid, ncpus, extra;
int i, cpuid, extra;

BUG_ON(sparc_cpu_model != sun4m);
printk("Entering SMP Mode...\n");

ncpus = 1;
extra = 0;
for (i = 0; !cpu_find_by_instance(i, NULL, &cpuid); i++) {
if (cpuid == boot_cpu_id)
continue;
if (cpuid < NR_CPUS && ncpus++ < max_cpus)
cpu_set(cpuid, phys_cpu_present_map);
else
if (cpuid >= NR_CPUS)
extra++;
}
if (max_cpus >= NR_CPUS && extra)
/* i = number of cpus */
if (extra && max_cpus > i - extra)
printk("Warning: NR_CPUS is too low to start all cpus\n");

smp_store_cpu_info(boot_cpu_id);

smp4m_boot_cpus();
}

void __devinit smp_prepare_boot_cpu(void)
/* Set this up early so that things like the scheduler can init
* properly. We use the same cpu mask for both the present and
* possible cpu map.
*/
void __init smp_setup_cpu_possible_map(void)
{
int instance, mid;

instance = 0;
while (!cpu_find_by_instance(instance, NULL, &mid)) {
if (mid < NR_CPUS) {
cpu_set(mid, phys_cpu_present_map);
cpu_set(mid, cpu_present_map);
}
instance++;
}
}

void __init smp_prepare_boot_cpu(void)
{
int cpuid = hard_smp_processor_id();

Expand All @@ -306,7 +320,7 @@ void __devinit smp_prepare_boot_cpu(void)
cpu_set(cpuid, phys_cpu_present_map);
}

int __devinit __cpu_up(unsigned int cpu)
int __cpuinit __cpu_up(unsigned int cpu)
{
extern int smp4m_boot_one_cpu(int);
int ret;
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/kernel/sparc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
#endif
EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq));
EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq));
EXPORT_SYMBOL(BTFIXUP_CALL(__irq_itoa));
EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea));
EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
Expand Down
3 changes: 0 additions & 3 deletions arch/sparc/kernel/sun4c_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
static void sun4c_nop(void) {}
#endif

extern char *sun4m_irq_itoa(unsigned int irq);

void __init sun4c_init_IRQ(void)
{
struct linux_prom_registers int_regs[2];
Expand Down Expand Up @@ -238,7 +236,6 @@ void __init sun4c_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, sun4c_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4c_clear_profile_irq, BTFIXUPCALL_NOP);
BTFIXUPSET_CALL(load_profile_irq, sun4c_load_profile_irq, BTFIXUPCALL_NOP);
BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4c_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4c_nop, BTFIXUPCALL_NOP);
Expand Down
12 changes: 0 additions & 12 deletions arch/sparc/kernel/sun4d_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,17 +560,6 @@ void __init sun4d_init_sbi_irq(void)
}
}

static char *sun4d_irq_itoa(unsigned int irq)
{
static char buff[16];

if (irq < (1 << 5))
sprintf(buff, "%d", irq);
else
sprintf(buff, "%d,%x", sbus_to_pil[(irq >> 2) & 7], irq);
return buff;
}

void __init sun4d_init_IRQ(void)
{
local_irq_disable();
Expand All @@ -581,7 +570,6 @@ void __init sun4d_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4d_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);
Expand Down
8 changes: 0 additions & 8 deletions arch/sparc/kernel/sun4m_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,6 @@ static void sun4m_load_profile_irq(int cpu, unsigned int limit)
sun4m_timers->cpu_timers[cpu].l14_timer_limit = limit;
}

char *sun4m_irq_itoa(unsigned int irq)
{
static char buff[16];
sprintf(buff, "%d", irq);
return buff;
}

static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
{
int reg_count, irq, cpu;
Expand Down Expand Up @@ -388,7 +381,6 @@ void __init sun4m_init_IRQ(void)
BTFIXUPSET_CALL(clear_clock_irq, sun4m_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4m_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4m_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4m_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4m_send_ipi, BTFIXUPCALL_NORM);
Expand Down
9 changes: 2 additions & 7 deletions arch/sparc/kernel/sun4m_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static inline unsigned long swap(volatile unsigned long *ptr, unsigned long val)
static void smp_setup_percpu_timer(void);
extern void cpu_probe(void);

void __init smp4m_callin(void)
void __cpuinit smp4m_callin(void)
{
int cpuid = hard_smp_processor_id();

Expand Down Expand Up @@ -112,13 +112,8 @@ void __init smp4m_callin(void)
local_irq_enable();

cpu_set(cpuid, cpu_online_map);
/* last one in gets all the interrupts (for testing) */
set_irq_udt(boot_cpu_id);
}

extern void init_IRQ(void);
extern void cpu_panic(void);

/*
* Cycle through the processors asking the PROM to start each one.
*/
Expand All @@ -134,7 +129,7 @@ void __init smp4m_boot_cpus(void)
local_flush_cache_all();
}

int smp4m_boot_one_cpu(int i)
int __cpuinit smp4m_boot_one_cpu(int i)
{
extern unsigned long sun4m_cpu_startup;
unsigned long *entry = &sun4m_cpu_startup;
Expand Down
3 changes: 2 additions & 1 deletion arch/sparc/mm/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ static void iommu_flush_iotlb(iopte_t *iopte, unsigned int niopte)
unsigned long start;
unsigned long end;

start = (unsigned long)iopte & PAGE_MASK;
start = (unsigned long)iopte;
end = PAGE_ALIGN(start + niopte*sizeof(iopte_t));
start &= PAGE_MASK;
if (viking_mxcc_present) {
while(start < end) {
viking_mxcc_flush_page(start);
Expand Down
4 changes: 4 additions & 0 deletions arch/sparc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ config SYSVIPC_COMPAT
depends on COMPAT && SYSVIPC
default y

config GENERIC_HARDIRQS
bool
default y

menu "General machine setup"

config SMP
Expand Down
29 changes: 27 additions & 2 deletions arch/sparc64/defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17-rc3
# Fri May 12 12:43:49 2006
# Linux kernel version: 2.6.17
# Tue Jun 20 01:26:43 2006
#
CONFIG_SPARC=y
CONFIG_SPARC64=y
Expand Down Expand Up @@ -87,6 +87,7 @@ CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_SYSVIPC_COMPAT=y
CONFIG_GENERIC_HARDIRQS=y

#
# General machine setup
Expand Down Expand Up @@ -183,6 +184,8 @@ CONFIG_INET_ESP=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_TCP_CONG_ADVANCED=y
Expand All @@ -198,6 +201,9 @@ CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
CONFIG_TCP_CONG_VEGAS=m
CONFIG_TCP_CONG_SCALABLE=m
CONFIG_TCP_CONG_LP=m
CONFIG_TCP_CONG_VENO=m
CONFIG_TCP_CONG_COMPOUND=m
CONFIG_IPV6=m
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
Expand All @@ -207,7 +213,10 @@ CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
CONFIG_INET6_XFRM_MODE_TRANSPORT=m
CONFIG_INET6_XFRM_MODE_TUNNEL=m
CONFIG_IPV6_TUNNEL=m
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set

#
Expand Down Expand Up @@ -260,6 +269,7 @@ CONFIG_VLAN_8021Q=m
# Network testing
#
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
Expand Down Expand Up @@ -562,6 +572,7 @@ CONFIG_BNX2=m
# CONFIG_CHELSIO_T1 is not set
# CONFIG_IXGB is not set
# CONFIG_S2IO is not set
# CONFIG_MYRI10GE is not set

#
# Token Ring devices
Expand Down Expand Up @@ -811,6 +822,7 @@ CONFIG_HWMON=y
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
CONFIG_VIDEO_V4L2=y

#
# Digital Video Broadcasting Devices
Expand Down Expand Up @@ -1134,6 +1146,19 @@ CONFIG_USB_HIDDEV=y
#
# CONFIG_RTC_CLASS is not set

#
# DMA Engine support
#
# CONFIG_DMA_ENGINE is not set

#
# DMA Clients
#

#
# DMA Devices
#

#
# Misc Linux/SPARC drivers
#
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ unsigned int sun4v_vdev_device_interrupt(unsigned int dev_node)
return 0;
}

return sun4v_build_irq(sun4v_vdev_devhandle, irq, 5, 0);
return sun4v_build_irq(sun4v_vdev_devhandle, irq);
}

static const char *cpu_mid_prop(void)
Expand Down
Loading

0 comments on commit be883da

Please sign in to comment.