Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42573
b: refs/heads/master
c: dd8856b
h: refs/heads/master
i:
  42571: c89842e
v: v3
  • Loading branch information
Linus Torvalds committed Dec 6, 2006
1 parent ee36cde commit 9827ab6
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 20 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: 06328b4f7919e9d2169d45cadc5a37b828a78eda
refs/heads/master: dd8856bda5f1308beb113281b248683992998a9e
16 changes: 12 additions & 4 deletions trunk/arch/m68knommu/platform/5307/timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* timers.c -- generic ColdFire hardware timer support.
*
* Copyright (C) 1999-2003, Greg Ungerer (gerg@snapgear.com)
* Copyright (C) 1999-2006, Greg Ungerer (gerg@snapgear.com)
*/

/***************************************************************************/
Expand Down Expand Up @@ -44,6 +44,14 @@ unsigned int mcf_timerlevel = 5;
extern void mcf_settimericr(int timer, int level);
extern int mcf_timerirqpending(int timer);

#if defined(CONFIG_M532x)
#define __raw_readtrr __raw_readl
#define __raw_writetrr __raw_writel
#else
#define __raw_readtrr __raw_readw
#define __raw_writetrr __raw_writew
#endif

/***************************************************************************/

void coldfire_tick(void)
Expand All @@ -57,7 +65,7 @@ void coldfire_tick(void)
void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *))
{
__raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR));
__raw_writew(((MCF_BUSCLK / 16) / HZ), TA(MCFTIMER_TRR));
__raw_writetrr(((MCF_BUSCLK / 16) / HZ), TA(MCFTIMER_TRR));
__raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR));

Expand All @@ -76,7 +84,7 @@ unsigned long coldfire_timer_offset(void)
unsigned long trr, tcn, offset;

tcn = __raw_readw(TA(MCFTIMER_TCN));
trr = __raw_readw(TA(MCFTIMER_TRR));
trr = __raw_readtrr(TA(MCFTIMER_TRR));
offset = (tcn * (1000000 / HZ)) / trr;

/* Check if we just wrapped the counters and maybe missed a tick */
Expand Down Expand Up @@ -120,7 +128,7 @@ void coldfire_profile_init(void)
/* Set up TIMER 2 as high speed profile clock */
__raw_writew(MCFTIMER_TMR_DISABLE, PA(MCFTIMER_TMR));

__raw_writew(((MCF_CLK / 16) / PROFILEHZ), PA(MCFTIMER_TRR));
__raw_writetrr(((MCF_CLK / 16) / PROFILEHZ), PA(MCFTIMER_TRR));
__raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, PA(MCFTIMER_TMR));

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m68knommu/platform/68360/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void BSP_gettod (int *yearp, int *monp, int *dayp,
{
}

int BSP_hwclk(int op, struct hwclk_time *t)
int BSP_hwclk(int op, struct rtc_time *t)
{
if (!op) {
/* read */
Expand Down
54 changes: 51 additions & 3 deletions trunk/drivers/serial/mcfserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ struct timer_list mcfrs_timer_struct;
#if defined(CONFIG_HW_FEITH)
#define CONSOLE_BAUD_RATE 38400
#define DEFAULT_CBAUD B38400
#elif defined(CONFIG_MOD5272) || defined(CONFIG_M5208EVB) || defined(CONFIG_M5329EVB)
#elif defined(CONFIG_MOD5272) || defined(CONFIG_M5208EVB) || \
defined(CONFIG_M5329EVB) || defined(CONFIG_GILBARCO)
#define CONSOLE_BAUD_RATE 115200
#define DEFAULT_CBAUD B115200
#elif defined(CONFIG_ARNEWSH) || defined(CONFIG_FREESCALE) || \
Expand Down Expand Up @@ -109,12 +110,30 @@ static struct mcf_serial mcfrs_table[] = {
.irq = IRQBASE,
.flags = ASYNC_BOOT_AUTOCONF,
},
#ifdef MCFUART_BASE2
{ /* ttyS1 */
.magic = 0,
.addr = (volatile unsigned char *) (MCF_MBAR+MCFUART_BASE2),
.irq = IRQBASE+1,
.flags = ASYNC_BOOT_AUTOCONF,
},
#endif
#ifdef MCFUART_BASE3
{ /* ttyS2 */
.magic = 0,
.addr = (volatile unsigned char *) (MCF_MBAR+MCFUART_BASE3),
.irq = IRQBASE+2,
.flags = ASYNC_BOOT_AUTOCONF,
},
#endif
#ifdef MCFUART_BASE4
{ /* ttyS3 */
.magic = 0,
.addr = (volatile unsigned char *) (MCF_MBAR+MCFUART_BASE4),
.irq = IRQBASE+3,
.flags = ASYNC_BOOT_AUTOCONF,
},
#endif
};


Expand Down Expand Up @@ -1516,6 +1535,22 @@ static void mcfrs_irqinit(struct mcf_serial *info)
imrp = (volatile unsigned long *) (MCF_MBAR + MCFICM_INTC0 +
MCFINTC_IMRL);
*imrp &= ~((1 << (info->irq - MCFINT_VECBASE)) | 1);
#if defined(CONFIG_M527x)
{
/*
* External Pin Mask Setting & Enable External Pin for Interface
* mrcbis@aliceposta.it
*/
unsigned short *serpin_enable_mask;
serpin_enable_mask = (MCF_IPSBAR + MCF_GPIO_PAR_UART);
if (info->line == 0)
*serpin_enable_mask |= UART0_ENABLE_MASK;
else if (info->line == 1)
*serpin_enable_mask |= UART1_ENABLE_MASK;
else if (info->line == 2)
*serpin_enable_mask |= UART2_ENABLE_MASK;
}
#endif
#elif defined(CONFIG_M520x)
volatile unsigned char *icrp, *uartp;
volatile unsigned long *imrp;
Expand Down Expand Up @@ -1713,7 +1748,7 @@ mcfrs_init(void)
/* Initialize the tty_driver structure */
mcfrs_serial_driver->owner = THIS_MODULE;
mcfrs_serial_driver->name = "ttyS";
mcfrs_serial_driver->driver_name = "serial";
mcfrs_serial_driver->driver_name = "mcfserial";
mcfrs_serial_driver->major = TTY_MAJOR;
mcfrs_serial_driver->minor_start = 64;
mcfrs_serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
Expand Down Expand Up @@ -1797,10 +1832,23 @@ void mcfrs_init_console(void)
uartp[MCFUART_UMR] = MCFUART_MR1_PARITYNONE | MCFUART_MR1_CS8;
uartp[MCFUART_UMR] = MCFUART_MR2_STOP1;

#ifdef CONFIG_M5272
{
/*
* For the MCF5272, also compute the baudrate fraction.
*/
int fraction = MCF_BUSCLK - (clk * 32 * mcfrs_console_baud);
fraction *= 16;
fraction /= (32 * mcfrs_console_baud);
uartp[MCFUART_UFPD] = (fraction & 0xf); /* set fraction */
clk = (MCF_BUSCLK / mcfrs_console_baud) / 32;
}
#else
clk = ((MCF_BUSCLK / mcfrs_console_baud) + 16) / 32; /* set baud */
#endif

uartp[MCFUART_UBG1] = (clk & 0xff00) >> 8; /* set msb baud */
uartp[MCFUART_UBG2] = (clk & 0xff); /* set lsb baud */

uartp[MCFUART_UCSR] = MCFUART_UCSR_RXCLKTIMER | MCFUART_UCSR_TXCLKTIMER;
uartp[MCFUART_UCR] = MCFUART_UCR_RXENABLE | MCFUART_UCR_TXENABLE;

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-m68knommu/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ extern void (*mach_disable_irq)(unsigned int);
#define enable_irq(x) do { } while (0)
#define disable_irq(x) do { } while (0)
#define disable_irq_nosync(x) disable_irq(x)
#define irq_canonicalize(irq) (irq)

#endif /* _M68K_IRQ_H_ */
1 change: 1 addition & 0 deletions trunk/include/asm-m68knommu/rtc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <asm-m68k/rtc.h>
6 changes: 0 additions & 6 deletions trunk/include/asm-m68knommu/ucontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ typedef int greg_t;
#define NGREG 18
typedef greg_t gregset_t[NGREG];

#ifdef CONFIG_FPU
typedef struct fpregset {
int f_pcr;
int f_psr;
int f_fpiaddr;
int f_fpregs[8][3];
} fpregset_t;
#endif

struct mcontext {
int version;
gregset_t gregs;
#ifdef CONFIG_FPU
fpregset_t fpregs;
#endif
};

#define MCONTEXT_VERSION 2
Expand All @@ -29,9 +25,7 @@ struct ucontext {
struct ucontext *uc_link;
stack_t uc_stack;
struct mcontext uc_mcontext;
#ifdef CONFIG_FPU
unsigned long uc_filler[80];
#endif
sigset_t uc_sigmask; /* mask last for extensibility */
};

Expand Down
12 changes: 7 additions & 5 deletions trunk/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,17 @@ static int validate_mmap_request(struct file *file,
(flags & MAP_TYPE) != MAP_SHARED)
return -EINVAL;

if (PAGE_ALIGN(len) == 0)
return addr;

if (len > TASK_SIZE)
if (!len)
return -EINVAL;

/* Careful about overflows.. */
len = PAGE_ALIGN(len);
if (!len || len > TASK_SIZE)
return -ENOMEM;

/* offset overflow? */
if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
return -EINVAL;
return -EOVERFLOW;

if (file) {
/* validate file mapping requests */
Expand Down

0 comments on commit 9827ab6

Please sign in to comment.