Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279851
b: refs/heads/master
c: 69676c3
h: refs/heads/master
i:
  279849: 2433b3c
  279847: fffe6b3
v: v3
  • Loading branch information
Axel Lin authored and Marc Zyngier committed Dec 2, 2011
1 parent bfc75cd commit b2f4701
Show file tree
Hide file tree
Showing 137 changed files with 522 additions and 514 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: 2d13ccaa8797d7e599f3792aed4b1e44b47f94a5
refs/heads/master: 69676c37290317910543ad0bd14e70544fb3dbf2
9 changes: 4 additions & 5 deletions trunk/arch/arm/include/asm/mach/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ struct machine_desc {
unsigned int video_start; /* start of video RAM */
unsigned int video_end; /* end of video RAM */

unsigned char reserve_lp0 :1; /* never has lp0 */
unsigned char reserve_lp1 :1; /* never has lp1 */
unsigned char reserve_lp2 :1; /* never has lp2 */
char restart_mode; /* default restart mode */
unsigned int reserve_lp0 :1; /* never has lp0 */
unsigned int reserve_lp1 :1; /* never has lp1 */
unsigned int reserve_lp2 :1; /* never has lp2 */
unsigned int soft_reboot :1; /* soft reboot */
void (*fixup)(struct tag *, char **,
struct meminfo *);
void (*reserve)(void);/* reserve mem blocks */
Expand All @@ -45,7 +45,6 @@ struct machine_desc {
#ifdef CONFIG_MULTI_IRQ_HANDLER
void (*handle_irq)(struct pt_regs *);
#endif
void (*restart)(char, const char *);
};

/*
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ extern int __pure cpu_architecture(void);
extern void cpu_init(void);

void arm_machine_restart(char mode, const char *cmd);
void soft_restart(unsigned long);
extern void (*arm_pm_restart)(char str, const char *cmd);

#define UDBG_UNDEFINED (1 << 0)
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
extern const unsigned char relocate_new_kernel[];
extern const unsigned int relocate_new_kernel_size;

extern void setup_mm_for_reboot(void);
extern void setup_mm_for_reboot(char mode);

extern unsigned long kexec_start_address;
extern unsigned long kexec_indirection_page;
Expand Down Expand Up @@ -114,7 +114,7 @@ void machine_kexec(struct kimage *image)
kexec_reinit();
local_irq_disable();
local_fiq_disable();
setup_mm_for_reboot();
setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
flush_cache_all();
outer_flush_all();
outer_disable();
Expand Down
35 changes: 14 additions & 21 deletions trunk/arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static const char *isa_modes[] = {
"ARM" , "Thumb" , "Jazelle", "ThumbEE"
};

extern void setup_mm_for_reboot(void);
extern void setup_mm_for_reboot(char mode);

static volatile int hlt_counter;

Expand Down Expand Up @@ -92,7 +92,7 @@ static int __init hlt_setup(char *__unused)
__setup("nohlt", nohlt_setup);
__setup("hlt", hlt_setup);

void soft_restart(unsigned long addr)
void arm_machine_restart(char mode, const char *cmd)
{
/* Disable interrupts first */
local_irq_disable();
Expand All @@ -103,7 +103,7 @@ void soft_restart(unsigned long addr)
* we may need it to insert some 1:1 mappings so that
* soft boot works.
*/
setup_mm_for_reboot();
setup_mm_for_reboot(mode);

/* Clean and invalidate caches */
flush_cache_all();
Expand All @@ -114,17 +114,18 @@ void soft_restart(unsigned long addr)
/* Push out any further dirty data, and ensure cache is empty */
flush_cache_all();

cpu_reset(addr);
}

void arm_machine_restart(char mode, const char *cmd)
{
/* Disable interrupts first */
local_irq_disable();
local_fiq_disable();

/* Call the architecture specific reboot code. */
/*
* Now call the architecture specific reboot code.
*/
arch_reset(mode, cmd);

/*
* Whoops - the architecture was unable to reboot.
* Tell the user!
*/
mdelay(1000);
printk("Reboot failed -- System halted\n");
while (1);
}

/*
Expand Down Expand Up @@ -249,15 +250,7 @@ void machine_power_off(void)
void machine_restart(char *cmd)
{
machine_shutdown();

arm_pm_restart(reboot_mode, cmd);

/* Give a grace period for failure to restart of 1s */
mdelay(1000);

/* Whoops - the platform was unable to reboot. Tell the user! */
printk("Reboot failed -- System halted\n");
while (1);
}

void __show_regs(struct pt_regs *regs)
Expand Down
7 changes: 2 additions & 5 deletions trunk/arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,8 @@ void __init setup_arch(char **cmdline_p)
machine_desc = mdesc;
machine_name = mdesc->name;

if (mdesc->restart_mode)
reboot_setup(&mdesc->restart_mode);
if (mdesc->soft_reboot)
reboot_setup("s");

init_mm.start_code = (unsigned long) _text;
init_mm.end_code = (unsigned long) _etext;
Expand All @@ -922,9 +922,6 @@ void __init setup_arch(char **cmdline_p)
paging_init(mdesc);
request_standard_resources(mdesc);

if (mdesc->restart)
arm_pm_restart = mdesc->restart;

unflatten_device_tree();

#ifdef CONFIG_SMP
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-clps711x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Object file lists.

obj-y := common.o
obj-y := irq.o mm.o time.o
obj-m :=
obj-n :=
obj- :=
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-clps711x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static inline void arch_idle(void)

static inline void arch_reset(char mode, const char *cmd)
{
soft_restart(0);
cpu_reset(0);
}

#endif
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*
* linux/arch/arm/mach-clps711x/core.c
* linux/arch/arm/mach-clps711x/irq.c
*
* Core support for the CLPS711x-based machines.
*
* Copyright (C) 2001,2011 Deep Blue Solutions Ltd
* Copyright (C) 2000 Deep Blue Solutions Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -19,41 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/sched.h>
#include <linux/timex.h>

#include <asm/sizes.h>
#include <asm/mach/irq.h>
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm/leds.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/hardware/clps7111.h>

/*
* This maps the generic CLPS711x registers
*/
static struct map_desc clps711x_io_desc[] __initdata = {
{
.virtual = CLPS7111_VIRT_BASE,
.pfn = __phys_to_pfn(CLPS7111_PHYS_BASE),
.length = SZ_1M,
.type = MT_DEVICE
}
};

void __init clps711x_map_io(void)
{
iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
}
#include <asm/hardware/clps7111.h>

static void int1_mask(struct irq_data *d)
{
Expand Down Expand Up @@ -140,15 +112,15 @@ void __init clps711x_init_irq(void)

for (i = 0; i < NR_IRQS; i++) {
if (INT1_IRQS & (1 << i)) {
irq_set_chip_and_handler(i, &int1_chip,
irq_set_chip_and_handler(i, &int1_chip,
handle_level_irq);
set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
}
if (INT2_IRQS & (1 << i)) {
irq_set_chip_and_handler(i, &int2_chip,
handle_level_irq);
set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
}
}
}

/*
Expand All @@ -169,54 +141,3 @@ void __init clps711x_init_irq(void)
clps_writel(0, SYNCIO);
clps_writel(0, KBDEOI);
}

/*
* gettimeoffset() returns time since last timer tick, in usecs.
*
* 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
* 'tick' is usecs per jiffy.
*/
static unsigned long clps711x_gettimeoffset(void)
{
unsigned long hwticks;
hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */
return (hwticks * (tick_nsec / 1000)) / LATCH;
}

/*
* IRQ handler for the timer
*/
static irqreturn_t p720t_timer_interrupt(int irq, void *dev_id)
{
timer_tick();
return IRQ_HANDLED;
}

static struct irqaction clps711x_timer_irq = {
.name = "CLPS711x Timer Tick",
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
.handler = p720t_timer_interrupt,
};

static void __init clps711x_timer_init(void)
{
struct timespec tv;
unsigned int syscon;

syscon = clps_readl(SYSCON1);
syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
clps_writel(syscon, SYSCON1);

clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */

setup_irq(IRQ_TC2OI, &clps711x_timer_irq);

tv.tv_nsec = 0;
tv.tv_sec = clps_readl(RTCDR);
do_settimeofday(&tv);
}

struct sys_timer clps711x_timer = {
.init = clps711x_timer_init,
.offset = clps711x_gettimeoffset,
};
48 changes: 48 additions & 0 deletions trunk/arch/arm/mach-clps711x/mm.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* linux/arch/arm/mach-clps711x/mm.c
*
* Generic MM setup for the CLPS711x-based machines.
*
* Copyright (C) 2001 Deep Blue Solutions Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/init.h>

#include <asm/sizes.h>
#include <mach/hardware.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/mach/map.h>
#include <asm/hardware/clps7111.h>

/*
* This maps the generic CLPS711x registers
*/
static struct map_desc clps711x_io_desc[] __initdata = {
{
.virtual = CLPS7111_VIRT_BASE,
.pfn = __phys_to_pfn(CLPS7111_PHYS_BASE),
.length = SZ_1M,
.type = MT_DEVICE
}
};

void __init clps711x_map_io(void)
{
iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
}
Loading

0 comments on commit b2f4701

Please sign in to comment.