Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43414
b: refs/heads/master
c: 5283304
h: refs/heads/master
v: v3
  • Loading branch information
Lennert Buytenhek authored and Russell King committed Dec 1, 2006
1 parent f22ca1a commit 87319be
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 339 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: 2dc20a51dc1e2da6eae1182cfe4c4835fca26017
refs/heads/master: 5283304bdcb4af47c46280ac21100d037d31fcf0
1 change: 1 addition & 0 deletions trunk/arch/arm/configs/ep93xx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ CONFIG_CRUNCH=y
#
# EP93xx Platforms
#
CONFIG_MACH_ADSSPHERE=y
CONFIG_MACH_EDB9302=y
CONFIG_MACH_EDB9312=y
CONFIG_MACH_EDB9315=y
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-ep93xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ config CRUNCH

comment "EP93xx Platforms"

config MACH_ADSSPHERE
bool "Support ADS Sphere"
help
Say 'Y' here if you want your kernel to support the ADS
Sphere board.

config MACH_EDB9302
bool "Support Cirrus Logic EDB9302"
help
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-ep93xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o
obj-$(CONFIG_MACH_EDB9302) += edb9302.o
obj-$(CONFIG_MACH_EDB9312) += edb9312.o
obj-$(CONFIG_MACH_EDB9315) += edb9315.o
Expand Down
91 changes: 91 additions & 0 deletions trunk/arch/arm/mach-ep93xx/adssphere.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* arch/arm/mach-ep93xx/adssphere.c
* ADS Sphere support.
*
* Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
*
* 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.
*/

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_device.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>

static struct physmap_flash_data adssphere_flash_data = {
.width = 4,
};

static struct resource adssphere_flash_resource = {
.start = 0x60000000,
.end = 0x61ffffff,
.flags = IORESOURCE_MEM,
};

static struct platform_device adssphere_flash = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &adssphere_flash_data,
},
.num_resources = 1,
.resource = &adssphere_flash_resource,
};

static struct ep93xx_eth_data adssphere_eth_data = {
.phy_id = 1,
};

static struct resource adssphere_eth_resource[] = {
{
.start = EP93XX_ETHERNET_PHYS_BASE,
.end = EP93XX_ETHERNET_PHYS_BASE + 0xffff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_EP93XX_ETHERNET,
.end = IRQ_EP93XX_ETHERNET,
.flags = IORESOURCE_IRQ,
}
};

static struct platform_device adssphere_eth_device = {
.name = "ep93xx-eth",
.id = -1,
.dev = {
.platform_data = &adssphere_eth_data,
},
.num_resources = 2,
.resource = adssphere_eth_resource,
};

static void __init adssphere_init_machine(void)
{
ep93xx_init_devices();
platform_device_register(&adssphere_flash);

memcpy(adssphere_eth_data.dev_addr,
(void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
platform_device_register(&adssphere_eth_device);
}

MACHINE_START(ADSSPHERE, "ADS Sphere board")
/* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
.phys_io = EP93XX_APB_PHYS_BASE,
.io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
.boot_params = 0x00000100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.timer = &ep93xx_timer,
.init_machine = adssphere_init_machine,
MACHINE_END
60 changes: 0 additions & 60 deletions trunk/arch/arm/mach-pxa/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
#include <linux/pm.h>
#include <linux/string.h>

#include <linux/sched.h>
#include <asm/cnt32_to_63.h>
#include <asm/div64.h>

#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/system.h>
Expand All @@ -44,62 +40,6 @@

#include "generic.h"

/*
* This is the PXA2xx sched_clock implementation. This has a resolution
* of at least 308ns and a maximum value that depends on the value of
* CLOCK_TICK_RATE.
*
* The return value is guaranteed to be monotonic in that range as
* long as there is always less than 582 seconds between successive
* calls to this function.
*/
unsigned long long sched_clock(void)
{
unsigned long long v = cnt32_to_63(OSCR);
/* Note: top bit ov v needs cleared unless multiplier is even. */

#if CLOCK_TICK_RATE == 3686400
/* 1E9 / 3686400 => 78125 / 288, max value = 32025597s (370 days). */
/* The <<1 is used to get rid of tick.hi top bit */
v *= 78125<<1;
do_div(v, 288<<1);
#elif CLOCK_TICK_RATE == 3250000
/* 1E9 / 3250000 => 4000 / 13, max value = 709490156s (8211 days) */
v *= 4000;
do_div(v, 13);
#elif CLOCK_TICK_RATE == 3249600
/* 1E9 / 3249600 => 625000 / 2031, max value = 4541295s (52 days) */
v *= 625000;
do_div(v, 2031);
#else
#warning "consider fixing sched_clock for your value of CLOCK_TICK_RATE"
/*
* 96-bit math to perform tick * NSEC_PER_SEC / CLOCK_TICK_RATE for
* any value of CLOCK_TICK_RATE. Max value is in the 80 thousand
* years range which is nice, but with higher computation cost.
*/
{
union {
unsigned long long val;
struct { unsigned long lo, hi; };
} x;
unsigned long long y;

x.val = v;
x.hi &= 0x7fffffff;
y = (unsigned long long)x.lo * NSEC_PER_SEC;
x.lo = y;
y = (y >> 32) + (unsigned long long)x.hi * NSEC_PER_SEC;
x.hi = do_div(y, CLOCK_TICK_RATE);
do_div(x.val, CLOCK_TICK_RATE);
x.hi += y;
v = x.val;
}
#endif

return v;
}

/*
* Handy function to set GPIO alternate functions
*/
Expand Down
15 changes: 4 additions & 11 deletions trunk/arch/arm/mach-sa1100/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/platform_device.h>

#include <asm/div64.h>
#include <asm/cnt32_to_63.h>
#include <asm/hardware.h>
#include <asm/system.h>
#include <asm/pgtable.h>
Expand Down Expand Up @@ -119,21 +118,15 @@ EXPORT_SYMBOL(cpufreq_get);

/*
* This is the SA11x0 sched_clock implementation. This has
* a resolution of 271ns, and a maximum value of 32025597s (370 days).
*
* The return value is guaranteed to be monotonic in that range as
* long as there is always less than 582 seconds between successive
* calls to this function.
*
* a resolution of 271ns, and a maximum value of 1165s.
* ( * 1E9 / 3686400 => * 78125 / 288)
*/
unsigned long long sched_clock(void)
{
unsigned long long v = cnt32_to_63(OSCR);
unsigned long long v;

/* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
v *= 78125<<1;
do_div(v, 288<<1);
v = (unsigned long long)OSCR * 78125;
do_div(v, 288);

return v;
}
Expand Down
14 changes: 4 additions & 10 deletions trunk/arch/arm/mach-versatile/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <linux/amba/bus.h>
#include <linux/amba/clcd.h>

#include <asm/cnt32_to_63.h>
#include <asm/system.h>
#include <asm/hardware.h>
#include <asm/io.h>
Expand Down Expand Up @@ -229,19 +228,14 @@ void __init versatile_map_io(void)

/*
* This is the Versatile sched_clock implementation. This has
* a resolution of 41.7ns, and a maximum value of about 35583 days.
*
* The return value is guaranteed to be monotonic in that range as
* long as there is always less than 89 seconds between successive
* calls to this function.
* a resolution of 41.7ns, and a maximum value of about 179s.
*/
unsigned long long sched_clock(void)
{
unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER));
unsigned long long v;

/* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
v *= 125<<1;
do_div(v, 3<<1);
v = (unsigned long long)readl(VERSATILE_REFCOUNTER) * 125;
do_div(v, 3);

return v;
}
Expand Down
78 changes: 0 additions & 78 deletions trunk/include/asm-arm/cnt32_to_63.h

This file was deleted.

Loading

0 comments on commit 87319be

Please sign in to comment.