Commit 9d22e6d7 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SUNLANCE]: fix compilation on sparc-UP
  [SPARC]: Defer clock_probe to fs_initcall()
  [SPARC64]: Fix typo in pgprot_noncached().
  [SPARC64]: Fix quad-float multiply emulation.
parents 159099dc 93853fd0
...@@ -225,6 +225,32 @@ static __inline__ int has_low_battery(void) ...@@ -225,6 +225,32 @@ static __inline__ int has_low_battery(void)
return (data1 == data2); /* Was the write blocked? */ return (data1 == data2); /* Was the write blocked? */
} }
static void __init mostek_set_system_time(void)
{
unsigned int year, mon, day, hour, min, sec;
struct mostek48t02 *mregs;
mregs = (struct mostek48t02 *)mstk48t02_regs;
if(!mregs) {
prom_printf("Something wrong, clock regs not mapped yet.\n");
prom_halt();
}
spin_lock_irq(&mostek_lock);
mregs->creg |= MSTK_CREG_READ;
sec = MSTK_REG_SEC(mregs);
min = MSTK_REG_MIN(mregs);
hour = MSTK_REG_HOUR(mregs);
day = MSTK_REG_DOM(mregs);
mon = MSTK_REG_MONTH(mregs);
year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
mregs->creg &= ~MSTK_CREG_READ;
spin_unlock_irq(&mostek_lock);
}
/* Probe for the real time clock chip on Sun4 */ /* Probe for the real time clock chip on Sun4 */
static __inline__ void sun4_clock_probe(void) static __inline__ void sun4_clock_probe(void)
{ {
...@@ -273,6 +299,7 @@ static __inline__ void sun4_clock_probe(void) ...@@ -273,6 +299,7 @@ static __inline__ void sun4_clock_probe(void)
#endif #endif
} }
#ifndef CONFIG_SUN4
static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->node; struct device_node *dp = op->node;
...@@ -307,6 +334,8 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id ...@@ -307,6 +334,8 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP) if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
kick_start_clock(); kick_start_clock();
mostek_set_system_time();
return 0; return 0;
} }
...@@ -325,56 +354,37 @@ static struct of_platform_driver clock_driver = { ...@@ -325,56 +354,37 @@ static struct of_platform_driver clock_driver = {
/* Probe for the mostek real time clock chip. */ /* Probe for the mostek real time clock chip. */
static void clock_init(void) static int __init clock_init(void)
{ {
of_register_driver(&clock_driver, &of_bus_type); return of_register_driver(&clock_driver, &of_bus_type);
} }
/* Must be after subsys_initcall() so that busses are probed. Must
* be before device_initcall() because things like the RTC driver
* need to see the clock registers.
*/
fs_initcall(clock_init);
#endif /* !CONFIG_SUN4 */
void __init sbus_time_init(void) void __init sbus_time_init(void)
{ {
unsigned int year, mon, day, hour, min, sec;
struct mostek48t02 *mregs;
#ifdef CONFIG_SUN4
int temp;
struct intersil *iregs;
#endif
BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM);
btfixup(); btfixup();
if (ARCH_SUN4) if (ARCH_SUN4)
sun4_clock_probe(); sun4_clock_probe();
else
clock_init();
sparc_init_timers(timer_interrupt); sparc_init_timers(timer_interrupt);
#ifdef CONFIG_SUN4 #ifdef CONFIG_SUN4
if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) { if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) {
#endif mostek_set_system_time();
mregs = (struct mostek48t02 *)mstk48t02_regs;
if(!mregs) {
prom_printf("Something wrong, clock regs not mapped yet.\n");
prom_halt();
}
spin_lock_irq(&mostek_lock);
mregs->creg |= MSTK_CREG_READ;
sec = MSTK_REG_SEC(mregs);
min = MSTK_REG_MIN(mregs);
hour = MSTK_REG_HOUR(mregs);
day = MSTK_REG_DOM(mregs);
mon = MSTK_REG_MONTH(mregs);
year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
mregs->creg &= ~MSTK_CREG_READ;
spin_unlock_irq(&mostek_lock);
#ifdef CONFIG_SUN4
} else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) { } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) {
/* initialise the intersil on sun4 */ /* initialise the intersil on sun4 */
unsigned int year, mon, day, hour, min, sec;
int temp;
struct intersil *iregs;
iregs=intersil_clock; iregs=intersil_clock;
if(!iregs) { if(!iregs) {
......
...@@ -1537,7 +1537,7 @@ static int __init sparc_lance_init(void) ...@@ -1537,7 +1537,7 @@ static int __init sparc_lance_init(void)
{ {
if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) || if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) ||
(idprom->id_machtype == (SM_SUN4|SM_4_470))) { (idprom->id_machtype == (SM_SUN4|SM_4_470))) {
memset(&sun4_sdev, 0, sizeof(sdev)); memset(&sun4_sdev, 0, sizeof(struct sbus_dev));
sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr; sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr;
sun4_sdev.irqs[0] = 6; sun4_sdev.irqs[0] = 6;
return sparc_lance_probe_one(&sun4_sdev, NULL, NULL); return sparc_lance_probe_one(&sun4_sdev, NULL, NULL);
...@@ -1547,16 +1547,16 @@ static int __init sparc_lance_init(void) ...@@ -1547,16 +1547,16 @@ static int __init sparc_lance_init(void)
static int __exit sunlance_sun4_remove(void) static int __exit sunlance_sun4_remove(void)
{ {
struct lance_private *lp = dev_get_drvdata(&sun4_sdev->dev); struct lance_private *lp = dev_get_drvdata(&sun4_sdev.ofdev.dev);
struct net_device *net_dev = lp->dev; struct net_device *net_dev = lp->dev;
unregister_netdevice(net_dev); unregister_netdevice(net_dev);
lance_free_hwresources(root_lance_dev); lance_free_hwresources(lp);
free_netdev(net_dev); free_netdev(net_dev);
dev_set_drvdata(&sun4_sdev->dev, NULL); dev_set_drvdata(&sun4_sdev.ofdev.dev, NULL);
return 0; return 0;
} }
......
...@@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot) ...@@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
" .section .sun4v_2insn_patch, \"ax\"\n" " .section .sun4v_2insn_patch, \"ax\"\n"
" .word 661b\n" " .word 661b\n"
" andn %0, %4, %0\n" " andn %0, %4, %0\n"
" or %0, %3, %0\n" " or %0, %5, %0\n"
" .previous\n" " .previous\n"
: "=r" (val) : "=r" (val)
: "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U), : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U),
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define _FP_MUL_MEAT_D(R,X,Y) \ #define _FP_MUL_MEAT_D(R,X,Y) \
_FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
#define _FP_MUL_MEAT_Q(R,X,Y) \ #define _FP_MUL_MEAT_Q(R,X,Y) \
_FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment