Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75389
b: refs/heads/master
c: 745a4c9
h: refs/heads/master
i:
  75387: 58ffe40
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jan 11, 2008
1 parent 5d4e602 commit 443eb42
Show file tree
Hide file tree
Showing 17 changed files with 178 additions and 148 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 460c54b779fce3490ab70a84fd2ef59250ca3d57
refs/heads/master: 745a4c9f0ba60a414224f2d5e4f0e8e25efd04e8
7 changes: 4 additions & 3 deletions trunk/arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static void __init bootmem_init(void)

static void __init bootmem_init(void)
{
unsigned long reserved_end;
unsigned long init_begin, reserved_end;
unsigned long mapstart = ~0UL;
unsigned long bootmap_size;
int i;
Expand Down Expand Up @@ -344,15 +344,16 @@ static void __init bootmem_init(void)
min_low_pfn, max_low_pfn);


init_begin = PFN_UP(__pa_symbol(&__init_begin));
for (i = 0; i < boot_mem_map.nr_map; i++) {
unsigned long start, end;

start = PFN_UP(boot_mem_map.map[i].addr);
end = PFN_DOWN(boot_mem_map.map[i].addr
+ boot_mem_map.map[i].size);

if (start <= min_low_pfn)
start = min_low_pfn;
if (start <= init_begin)
start = init_begin;
if (start >= end)
continue;

Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/mips/lasat/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ endif

MKLASATIMG = mklasatimg
MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
KERNEL_IMAGE = vmlinux
KERNEL_IMAGE = $(TOPDIR)/vmlinux
KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )

LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
LDSCRIPT= -L$(obj) -Tromscript.normal

HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
-D_kernel_entry=0x$(KERNEL_ENTRY) \
-D VERSION="\"$(Version)\"" \
-D TIMESTAMP=$(shell date +%s)

$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
$(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<

OBJECTS = head.o kImage.o

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mips/mips-boards/generic/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ void __init prom_meminit(void)

void __init prom_free_prom_memory(void)
{
#if 0 /* for now ... */
unsigned long addr;
int i;

Expand All @@ -180,4 +181,5 @@ void __init prom_free_prom_memory(void)
free_init_pages("prom memory",
addr, addr + boot_mem_map.map[i].size);
}
#endif
}
10 changes: 4 additions & 6 deletions trunk/arch/mips/mips-boards/generic/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ static void atlas_machine_power_off(void);

static void mips_machine_restart(char *command)
{
unsigned int __iomem *softres_reg =
ioremap(SOFTRES_REG, sizeof(unsigned int));
unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int));

__raw_writel(GORESET, softres_reg);
writew(GORESET, softres_reg);
}

static void mips_machine_halt(void)
{
unsigned int __iomem *softres_reg =
ioremap(SOFTRES_REG, sizeof(unsigned int));
unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int));

__raw_writel(GORESET, softres_reg);
writew(GORESET, softres_reg);
}

#if defined(CONFIG_MIPS_ATLAS)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/mm/dma-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
/* ignore region specifiers */
gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);

#ifdef CONFIG_ZONE_DMA
#ifdef CONFIG_ZONE_DMA32
if (dev == NULL)
gfp |= __GFP_DMA;
else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
Expand Down
109 changes: 37 additions & 72 deletions trunk/arch/mips/philips/pnx8550/common/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/kernel_stat.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/module.h>

#include <asm/bootinfo.h>
#include <asm/cpu.h>
Expand All @@ -40,60 +41,11 @@ static cycle_t hpt_read(void)
return read_c0_count2();
}

static struct clocksource pnx_clocksource = {
.name = "pnx8xxx",
.rating = 200,
.read = hpt_read,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static void timer_ack(void)
{
write_c0_compare(cpj);
}

static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
{
struct clock_event_device *c = dev_id;

/* clear MATCH, signal the event */
c->event_handler(c);

return IRQ_HANDLED;
}

static struct irqaction pnx8xxx_timer_irq = {
.handler = pnx8xxx_timer_interrupt,
.flags = IRQF_DISABLED | IRQF_PERCPU,
.name = "pnx8xxx_timer",
};

static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
{
/* Timer 2 clear interrupt */
write_c0_compare2(-1);
return IRQ_HANDLED;
}

static struct irqaction monotonic_irqaction = {
.handler = monotonic_interrupt,
.flags = IRQF_DISABLED,
.name = "Monotonic timer",
};

static int pnx8xxx_set_next_event(unsigned long delta,
struct clock_event_device *evt)
{
write_c0_compare(delta);
return 0;
}

static struct clock_event_device pnx8xxx_clockevent = {
.name = "pnx8xxx_clockevent",
.features = CLOCK_EVT_FEAT_ONESHOT,
.set_next_event = pnx8xxx_set_next_event,
};

/*
* plat_time_init() - it does the following things:
*
Expand All @@ -106,34 +58,11 @@ static struct clock_event_device pnx8xxx_clockevent = {

__init void plat_time_init(void)
{
unsigned int configPR;
unsigned int n;
unsigned int m;
unsigned int p;
unsigned int pow2p;

clockevents_register_device(&pnx8xxx_clockevent);
clocksource_register(&pnx_clocksource);

setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);

/* Timer 1 start */
configPR = read_c0_config7();
configPR &= ~0x00000008;
write_c0_config7(configPR);

/* Timer 2 start */
configPR = read_c0_config7();
configPR &= ~0x00000010;
write_c0_config7(configPR);

/* Timer 3 stop */
configPR = read_c0_config7();
configPR |= 0x00000020;
write_c0_config7(configPR);


/* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
/* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */

Expand All @@ -158,6 +87,42 @@ __init void plat_time_init(void)
write_c0_count2(0);
write_c0_compare2(0xffffffff);

clocksource_mips.read = hpt_read;
mips_timer_ack = timer_ack;
}

static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
{
/* Timer 2 clear interrupt */
write_c0_compare2(-1);
return IRQ_HANDLED;
}

static struct irqaction monotonic_irqaction = {
.handler = monotonic_interrupt,
.flags = IRQF_DISABLED,
.name = "Monotonic timer",
};

void __init plat_timer_setup(struct irqaction *irq)
{
int configPR;

setup_irq(PNX8550_INT_TIMER1, irq);
setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);

/* Timer 1 start */
configPR = read_c0_config7();
configPR &= ~0x00000008;
write_c0_config7(configPR);

/* Timer 2 start */
configPR = read_c0_config7();
configPR &= ~0x00000010;
write_c0_config7(configPR);

/* Timer 3 stop */
configPR = read_c0_config7();
configPR |= 0x00000020;
write_c0_config7(configPR);
}
81 changes: 78 additions & 3 deletions trunk/block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/time.h>
#include <asm/uaccess.h>

static DEFINE_PER_CPU(unsigned long long, blk_trace_cpu_offset) = { 0, };
static unsigned int blktrace_seq __read_mostly = 1;

/*
Expand All @@ -40,7 +41,7 @@ static void trace_note(struct blk_trace *bt, pid_t pid, int action,
const int cpu = smp_processor_id();

t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
t->time = ktime_to_ns(ktime_get());
t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
t->device = bt->dev;
t->action = action;
t->pid = pid;
Expand Down Expand Up @@ -158,7 +159,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,

t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
t->sequence = ++(*sequence);
t->time = ktime_to_ns(ktime_get());
t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
t->sector = sector;
t->bytes = bytes;
t->action = what;
Expand All @@ -178,7 +179,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
EXPORT_SYMBOL_GPL(__blk_add_trace);

static struct dentry *blk_tree_root;
static DEFINE_MUTEX(blk_tree_mutex);
static struct mutex blk_tree_mutex;
static unsigned int root_users;

static inline void blk_remove_root(void)
Expand Down Expand Up @@ -504,3 +505,77 @@ void blk_trace_shutdown(struct request_queue *q)
blk_trace_remove(q);
}
}

/*
* Average offset over two calls to cpu_clock() with a gettimeofday()
* in the middle
*/
static void blk_check_time(unsigned long long *t, int this_cpu)
{
unsigned long long a, b;
struct timeval tv;

a = cpu_clock(this_cpu);
do_gettimeofday(&tv);
b = cpu_clock(this_cpu);

*t = tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
*t -= (a + b) / 2;
}

/*
* calibrate our inter-CPU timings
*/
static void blk_trace_check_cpu_time(void *data)
{
unsigned long long *t;
int this_cpu = get_cpu();

t = &per_cpu(blk_trace_cpu_offset, this_cpu);

/*
* Just call it twice, hopefully the second call will be cache hot
* and a little more precise
*/
blk_check_time(t, this_cpu);
blk_check_time(t, this_cpu);

put_cpu();
}

static void blk_trace_set_ht_offsets(void)
{
#if defined(CONFIG_SCHED_SMT)
int cpu, i;

/*
* now make sure HT siblings have the same time offset
*/
preempt_disable();
for_each_online_cpu(cpu) {
unsigned long long *cpu_off, *sibling_off;

for_each_cpu_mask(i, per_cpu(cpu_sibling_map, cpu)) {
if (i == cpu)
continue;

cpu_off = &per_cpu(blk_trace_cpu_offset, cpu);
sibling_off = &per_cpu(blk_trace_cpu_offset, i);
*sibling_off = *cpu_off;
}
}
preempt_enable();
#endif
}

static __init int blk_trace_init(void)
{
mutex_init(&blk_tree_mutex);
on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1);
blk_trace_set_ht_offsets();

return 0;
}

module_init(blk_trace_init);

2 changes: 1 addition & 1 deletion trunk/drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ static int loop_thread(void *data)
static int loop_switch(struct loop_device *lo, struct file *file)
{
struct switch_request w;
struct bio *bio = bio_alloc(GFP_KERNEL, 0);
struct bio *bio = bio_alloc(GFP_KERNEL, 1);
if (!bio)
return -ENOMEM;
init_completion(&w.wait);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/ide/ide-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ static const struct dmi_system_id ide_acpi_dmi_table[] = {
DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60")
},
},

{ } /* terminate list */
};

static int ide_acpi_blacklist(void)
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,10 +1076,6 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
ivtv_process_eeprom(itv);
}

/* The mspx4xx chips need a longer delay for some reason */
if (!(itv->hw_flags & IVTV_HW_MSP34XX))
itv->i2c_algo.udelay = 5;

if (itv->std == 0) {
itv->std = V4L2_STD_NTSC_M;
}
Expand Down
Loading

0 comments on commit 443eb42

Please sign in to comment.