* Re: [PATCH] cpm_uart: Made non-console uart work
From: Kumar Gala @ 2005-08-02 18:35 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-embedded list, Pantelis Antoniou
In-Reply-To: <42EF9022.5050707@ru.mvista.com>
I want to test this out on the 8560 ADS to see if works there as well
before pushing upstream.
- kumar
On Aug 2, 2005, at 10:24 AM, Vitaly Bordug wrote:
> Kumar, Pantelis,
>
> This patch makes non-console UART work on both 8xx and 82xx. Various
> issues are resolved:
> - removed unnecessary STOP_TX commands in shutdown - no need to
> completely stop CPM TX and reinit BDs each time the port is closing;
> - when mem_addr has been allocated via dma_coherent_alloc, virt_to_bus
> on it will not tell the truth in most cases
> - SCC UART needs to wait several character times even after all the
> BDs
> have READY bit cleared
> - adds needed board-specific bits for 86xADS
>
> Tested on 8272ADS, 885ADS and 866ADS development boards.
> ---------------------------------
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
>
> --
> Sincerely,
> Vitaly
>
>
> <cpm_uart_fixes.patch>
>
^ permalink raw reply
* Re: Reply: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: Mark A. Greer @ 2005-08-02 17:35 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: FCG WANG Baohua, linuxppc-embedded
In-Reply-To: <20050802071522.AE98C353BF9@atlas.denx.de>
On Tue, Aug 02, 2005 at 09:15:22AM +0200, Wolfgang Denk wrote:
> In message <A9DE2BAF233E444FA9C5E77A5825A01E8652FA@ydmail.sbell.com.cn> you wrote:
> >
> > => bootm 0x180000
> > ## Booting image at 00000000 ...
> > Bad Magic Number
> > =>
>
> The funny thing is that you seem to enter "0x180000" but the address
> printed is 00000000. make sure you have no funny characters or
> control keys in this number. Re-type it carefully. Omit the "0x"
> part, i. e. try a plain "bootm 180000'
Plus, use 'bootm' for a .uboot file, 'bootelf' for a zImage.
^ permalink raw reply
* Re: mpc8248 SEC -- interrupt handler 'is' invoked
From: Vikas Aggarwal @ 2005-08-02 15:45 UTC (permalink / raw)
To: Kim Phillips; +Cc: linuxppc-embedded
In-Reply-To: <20050801123728.62764c7e.kim.phillips@freescale.com>
Hi Kim,
Code excerpts are at after the TRACE.
TRACE Messages from the test ---------
bash-2.05b# modprobe secmpc8248
bash-2.05b# ^[[K/lib/modules/2.6.10-rc3/\akernel/crypto/mpc8248/test
SEC1Open() called, inode 0xc0a564cc, file 0xc024e2f4
*** Test RNG ***
First ID=21474820 ChannelPointerStatusRegister[0]=0x0:
ChannelPointerStatusRegister[0]=0x7
ChannelPointerStatusRegister[1]=0x0: ChannelPointerStatusRegister[1]=0x7
ChannelPointerStatusRegister[2]=0x0: ChannelPointerStatusRegister[2]=0x7
ChannelPointerStatusRegister[3]=0x0: ChannelPointerStatusRegister[3]=0x7
ProcessRequest(): free channel = 0
RequestToDpd(): req @0x7ffff820 ch1
RequestToDpd(): get entry for opId 0x00001000
RequestToDpd(): VerifyRequest(0x7ffff820, 0xc11b9cf0)
RequestToDpd(): clear DPD 0xc11bb910
RequestToDpd(): converting entry4 4->0xc09ffc5c vikas
RequestToDpd(): set length = 160
DPD header = 0x40000011
Primary EU/Mode 0x04:00, Secondary EU/Mode 0x00:00, Desc Type 0x01, Snoop
Output Data Mode, Done
DPD ptr:len/ext p0 = 0x00000000:00000000
DPD ptr:len/ext p1 = 0x00000000:00000000
DPD ptr:len/ext p2 = 0x00000000:00000000
DPD ptr:len/ext p3 = 0x00000000:00000000
DPD ptr:len/ext p4 = 0x009ffc5c:000000a0
DPD ptr:len/ext p5 = 0x00000000:00000000
DPD ptr:len/ext p6 = 0x00000000:00000000
RequestToDpd() EndOfFunc: req @0x00000000 ch1
ProcessRequest() endOffunc: free channel = 0
InterruptServiceRoutine()
ProcessingComplete(): IntStatus - 0x0000000000000040
ProcessingComplete():->Controller_MEAR=0x011bb910
ChannelPointerStatusRegister[0]=0x7: ChannelPointerStatusRegister[0]=0x2007
ChannelPointerStatusRegister[1]=0x0: ChannelPointerStatusRegister[1]=0x7
ChannelPointerStatusRegister[2]=0x0: ChannelPointerStatusRegister[2]=0x7
ChannelPointerStatusRegister[3]=0x0: ChannelPointerStatusRegister[3]=0x7
Unknown
ProcessingComplete Done
ID1
nfs: server 192.168.2.4 not responding, still trying
nfs: server 192.168.2.4 OK
Request Ti ChannelPointerStatusRegister[0]=0x7:
ChannelPointerStatusRegister[0]=0x2007
ChannelPointerStatusRegister[1]=0x0: ChannelPointerStatusRegister[1]=0x7
ChannelPointerStatusRegister[2]=0x0: ChannelPointerStatusRegister[2]=0x7
ChannelPointerStatusRegister[3]=0x0: ChannelPointerStatusRegister[3]=0x7
testSEC1Close() called
ReleaseChannel(1, taskID=0x 148, lock=1)
bash-2.05b#
------------TRACE COMPLETE ------------------------
This is how i write the address of RNG buffer(sec1_dpd.c.
DPDPTR->fld[i].ptr = virt_to_phys(*(unsigned int *) ((unsigned int)pReq +
pDesc->fld[i].ptrOffset1st));
This is how i write the length of RNG buffer(sec1_dpd.c.
DPDPTR->fld[i].len = *(unsigned int *) ((unsigned int)pReq +
pDesc->fld[i].lenOffset1st);
DPDPTR->nxt_dpd_ptr = 0;
This is how i write the DPD's address?(sec1_request.c).
*(ChannelNextDescriptorRegister[freeChannel]+1) =
dma_map_single(NULL,(volatile void
*)(ChannelAssignments[freeChannel].Dpds[0]),64,DMA_BIDIRECTIONAL);
DPD_TABLE
-----------------------------------------------
/* DPD_FLD_DETAILS_ENTRY
Describes where and how a field in a request goes to a field in a DPD
*/
typedef struct
{
char *txt; /* Description of the
field within the request
a NULL indicates the end
of field entries */
unsigned int lenOffset1st; /* Offset into request
pointer
for the initial length
field */
unsigned int lenOffsetNxt; /* Offset into request
pointer
for the next length field
Used when input points to
output of the previous
request */
unsigned int ptrOffset1st; /* Offset into request
pointer
for the initial data
area */
unsigned int extOffset;
FLD_TYPE dataType; /* Data type either:
a "Read" or "Write"
area */
BOOLEAN (*pFncSize)(unsigned long len); /* Pointer to
function that checks
whether the length is
consistent with the
request */
} DPD_FLD_DETAILS_ENTRY;
/*! \struct DPD_DETAILS_ENTRY
\brief Describes how a request is broken into a single DPD or a set of
chained
DPDs
*/
typedef struct DPD_DETAILS_ENTRY
{
unsigned long opId; /* Operation ID for entry */
char *txt; /* Description of request
a NULL indicates the end
of the table */
unsigned long sz; /* Size of request */
const unsigned long *hdrDesc; /* Descriptor Header */
unsigned int lenOffsetBlockLen; /* Offset into request
pointer
for total length of
data */
DPD_FLD_DETAILS_ENTRY fld[NUM_DPD_FLDS];
} DPD_DETAILS_ENTRY; /* Each request is enumerated here */
#ifndef offsetof
/* offsetof(s,m)
Macro that identifies the byte offset of a field m within a structure s
*/
#define offsetof(s,m) (size_t)&(((s *)0)->m)
#endif
#define STD_OFFSETS(s,l1,l2,p1,p2) offsetof(s,l1), offsetof(s,l2),\
offsetof(s,p1), 0
#define EXT_OFFSETS(s,l1,l2,p1,p2) offsetof(s,l1), offsetof(s,l2),\
offsetof(s,p1), offsetof(s,p2)
#define NULL_PTR_OFFSETS(s,l1,l2) offsetof(s,l1), offsetof(s,l2), 0, 0
#define ZERO_LEN_OFFSETS(s,p1,p2) 0, 0, offsetof(s,p1), offsetof(s,p2)
#define ALL_ZERO_OFFSETS 0, 0, 0, 0
static char NIL[] = {"NIL"};
DPD_DETAILS_ENTRY DpdDetails[] =
{
/* DPD_RNG_GROUP */
{
DPD_RNG_GROUP, "DPD_RNG_GROUP",
sizeof(RNG_REQ), RngDesc,
offsetof(RNG_REQ,rngBytes),
{
{NIL, ALL_ZERO_OFFSETS, Read, NULL},
{NIL, ALL_ZERO_OFFSETS, Read, NULL},
{NIL, ALL_ZERO_OFFSETS, Read, NULL},
{NIL, ALL_ZERO_OFFSETS, Read, NULL},
{"rngData",
STD_OFFSETS(RNG_REQ,rngBytes,rngBytes,rngData,rngData), Write,
NULL},
{NULL, ALL_ZERO_OFFSETS, Read, NULL}
},
},
/* DPD_DES_CBC_GROUP */
{
----------------------------------
testRNG user-space function-----------
int testRng(int fd)
{
RNG_REQ rngReq;
int device=0, status;
/* RNG test */
printf("\n*** Test RNG ***\n");
memset(&rngReq, 0, sizeof(rngReq));
memset(rngBuf, 0, RNG_TESTSIZE);
rngReq.opId = DPD_RNG_GETRN;
rngReq.rngBytes = RNG_TESTSIZE;
rngReq.rngData = rngBuf;
status = putKmem(fd, "vikas\n\0", &rngReq.rngData, RNG_TESTSIZE);
if (status)
return status;
armCompletion(&rngReq);
{
int status1;
SEC1_STATUS statusReq;
printf("\nFirst ID=%d\n",statusReq.IdRegister);
status1 = ioctl(fd, IOCTL_GET_STATUS, (int)&statusReq);
}
status = ioctl(fd, IOCTL_PROC_REQ, (int)&rngReq);
printf("\nID1\n");
if (status = waitCompletion("testRng(): data extraction test", status,
&rngReq))
{
int status1;
SEC1_STATUS statusReq;
printf("\nID=%d\n",statusReq.IdRegister);
status1 = ioctl(fd, IOCTL_GET_STATUS, (int)&statusReq);
fflush(stdout);
freeKmem(fd, &rngReq.rngData);
return status;
}
printf("\nID2\n");
fflush(stdout);
getKmem(fd, rngBuf, &rngReq.rngData, RNG_TESTSIZE);
freeKmem(fd, &rngReq.rngData);
/* check random buffer content for nonzero */
if (rngBuf[0]) {
printf("*** Test RNG Data ***\n");
status = 0;
} else {
printf("*** Test RNG Failed ***\n");
status = -1;
}
return status;
}
------------------------------------------------------------------
> On Sun, 31 Jul 2005 20:48:16 -0400 (EDT)
> "Vikas Aggarwal" <va824363@albany.edu> wrote:
>
>> Tried it as u said . No luck :(
>> But something more i noted now in CPSR(channel pointer status
>> register=0x2040) that before ISR invoked it has 0x0:0x7.
>>
>> After ISR invoked it has 0x7:0x2007 . The 7 in low bits means
>> channel_error and 2 is at "reserved" bits as per documentation, don't
>> know
>> what that means.
>>
>> I also tried kmalloc with GFP_DMA, for the memory where i create the
>> Descriptor.
>> Please keep giving ideas for debugging this as this is what driving me
>> right now.
>> regards
>> -vikas
>
>
> So you reset the master, then the channel, allocate the RNG descriptor,
> allocate the random data buffer, fill the descriptor with values for an
> RNG request the size of your buffer (filling with the physical address of
> your random data buffer), and submit the descriptor's physical address to
> the FR..
>
> btw, I'm finding it hard to help without seeing sec register transaction
> data, descriptor data, virtual and physical addresses, etc.
>
> Kim
>
^ permalink raw reply
* [PATCH] cpm_uart: Made non-console uart work
From: Vitaly Bordug @ 2005-08-02 15:24 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-embedded list, Pantelis Antoniou
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
Kumar, Pantelis,
This patch makes non-console UART work on both 8xx and 82xx. Various
issues are resolved:
- removed unnecessary STOP_TX commands in shutdown - no need to
completely stop CPM TX and reinit BDs each time the port is closing;
- when mem_addr has been allocated via dma_coherent_alloc, virt_to_bus
on it will not tell the truth in most cases
- SCC UART needs to wait several character times even after all the BDs
have READY bit cleared
- adds needed board-specific bits for 86xADS
Tested on 8272ADS, 885ADS and 866ADS development boards.
---------------------------------
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
--
Sincerely,
Vitaly
[-- Attachment #2: cpm_uart_fixes.patch --]
[-- Type: text/x-patch, Size: 10899 bytes --]
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -40,6 +40,8 @@
#define TX_NUM_FIFO 4
#define TX_BUF_SIZE 32
+#define SCC_WAIT_CLOSING 100
+
struct uart_cpm_port {
struct uart_port port;
u16 rx_nrfifos;
@@ -67,6 +69,8 @@ struct uart_cpm_port {
int bits;
/* Keep track of 'odd' SMC2 wirings */
int is_portb;
+ /* wait on close if needed */
+ int wait_closing;
};
extern int cpm_uart_port_map[UART_NR];
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -12,6 +12,7 @@
*
* Copyright (C) 2004 Freescale Semiconductor, Inc.
* (C) 2004 Intracom, S.A.
+ * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com>
*
* 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
@@ -143,10 +144,13 @@ static void cpm_uart_start_tx(struct uar
}
if (cpm_uart_tx_pump(port) != 0) {
- if (IS_SMC(pinfo))
+ if (IS_SMC(pinfo)) {
smcp->smc_smcm |= SMCM_TX;
- else
+ smcp->smc_smcmr |= SMCMR_TEN;
+ } else {
sccp->scc_sccm |= UART_SCCM_TX;
+ pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT;
+ }
}
}
@@ -265,13 +269,15 @@ static void cpm_uart_int_rx(struct uart_
} /* End while (i--) */
/* This BD is ready to be used again. Clear status. get next */
- bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV);
+ bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID);
bdp->cbd_sc |= BD_SC_EMPTY;
- if (bdp->cbd_sc & BD_SC_WRAP)
- bdp = pinfo->rx_bd_base;
- else
- bdp++;
+ if (bdp->cbd_datlen) {
+ if (bdp->cbd_sc & BD_SC_WRAP)
+ bdp = pinfo->rx_bd_base;
+ else
+ bdp++;
+ }
} /* End for (;;) */
/* Write back buffer pointer */
@@ -336,22 +342,22 @@ static irqreturn_t cpm_uart_int(int irq,
if (IS_SMC(pinfo)) {
events = smcp->smc_smce;
+ smcp->smc_smce = events;
if (events & SMCM_BRKE)
uart_handle_break(port);
if (events & SMCM_RX)
cpm_uart_int_rx(port, regs);
if (events & SMCM_TX)
cpm_uart_int_tx(port, regs);
- smcp->smc_smce = events;
} else {
events = sccp->scc_scce;
+ sccp->scc_scce = events;
if (events & UART_SCCM_BRKE)
uart_handle_break(port);
if (events & UART_SCCM_RX)
cpm_uart_int_rx(port, regs);
if (events & UART_SCCM_TX)
cpm_uart_int_tx(port, regs);
- sccp->scc_scce = events;
}
return (events) ? IRQ_HANDLED : IRQ_NONE;
}
@@ -360,6 +366,7 @@ static int cpm_uart_startup(struct uart_
{
int retval;
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
+ int line = pinfo - cpm_uart_ports;
pr_debug("CPM uart[%d]:startup\n", port->line);
@@ -374,18 +381,30 @@ static int cpm_uart_startup(struct uart_
pinfo->smcp->smc_smcmr |= SMCMR_REN;
} else {
pinfo->sccp->scc_sccm |= UART_SCCM_RX;
+ pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENR;
}
+ cpm_line_cr_cmd(line,CPM_CR_RESTART_TX);
return 0;
}
+inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)
+{
+ unsigned long orig_jiffies = jiffies;
+ while(1)
+ {
+ schedule_timeout(2);
+ if(time_after(jiffies, orig_jiffies + pinfo->wait_closing))
+ break;
+ }
+}
+
/*
* Shutdown the uart
*/
static void cpm_uart_shutdown(struct uart_port *port)
{
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
- int line = pinfo - cpm_uart_ports;
pr_debug("CPM uart[%d]:shutdown\n", port->line);
@@ -394,6 +413,12 @@ static void cpm_uart_shutdown(struct uar
/* If the port is not the console, disable Rx and Tx. */
if (!(pinfo->flags & FLAG_CONSOLE)) {
+ /* Wait for all the BDs marked sent */
+ while(!cpm_uart_tx_empty(port))
+ schedule_timeout(2);
+ if(pinfo->wait_closing)
+ cpm_uart_wait_until_send(pinfo);
+
/* Stop uarts */
if (IS_SMC(pinfo)) {
volatile smc_t *smcp = pinfo->smcp;
@@ -405,9 +430,6 @@ static void cpm_uart_shutdown(struct uar
sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
}
- /* Shut them really down and reinit buffer descriptors */
- cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
- cpm_uart_initbd(pinfo);
}
}
@@ -569,7 +591,10 @@ static int cpm_uart_tx_pump(struct uart_
/* Pick next descriptor and fill from buffer */
bdp = pinfo->tx_cur;
- p = bus_to_virt(bdp->cbd_bufaddr);
+ if (pinfo->dma_addr)
+ p=(u8*)((ulong)(pinfo->mem_addr) + bdp->cbd_bufaddr - pinfo->dma_addr);
+ else
+ p = bus_to_virt(bdp->cbd_bufaddr);
*p++ = xmit->buf[xmit->tail];
bdp->cbd_datlen = 1;
bdp->cbd_sc |= BD_SC_READY;
@@ -595,7 +620,10 @@ static int cpm_uart_tx_pump(struct uart_
while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) {
count = 0;
- p = bus_to_virt(bdp->cbd_bufaddr);
+ if (pinfo->dma_addr)
+ p=(u8*)((ulong)(pinfo->mem_addr) + bdp->cbd_bufaddr - pinfo->dma_addr);
+ else
+ p = bus_to_virt(bdp->cbd_bufaddr);
while (count < pinfo->tx_fifosize) {
*p++ = xmit->buf[xmit->tail];
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -606,6 +634,7 @@ static int cpm_uart_tx_pump(struct uart_
}
bdp->cbd_datlen = count;
bdp->cbd_sc |= BD_SC_READY;
+ __asm__("eieio");
/* Get next BD. */
if (bdp->cbd_sc & BD_SC_WRAP)
bdp = pinfo->tx_bd_base;
@@ -632,6 +661,7 @@ static void cpm_uart_initbd(struct uart_
{
int i;
u8 *mem_addr;
+ u8* dma_addr;
volatile cbd_t *bdp;
pr_debug("CPM uart[%d]:initbd\n", pinfo->port.line);
@@ -641,14 +671,23 @@ static void cpm_uart_initbd(struct uart_
* virtual address for us to work with.
*/
mem_addr = pinfo->mem_addr;
+ dma_addr = (u8*)(pinfo->dma_addr);
bdp = pinfo->rx_cur = pinfo->rx_bd_base;
for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ if (pinfo->dma_addr)
+ bdp->cbd_bufaddr = (ulong)dma_addr;
+ else
+ bdp->cbd_bufaddr = virt_to_bus(mem_addr);
bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
+ bdp->cbd_datlen = 0;
mem_addr += pinfo->rx_fifosize;
+ dma_addr += pinfo->rx_fifosize;
}
-
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ if (pinfo->dma_addr)
+ bdp->cbd_bufaddr = (ulong)dma_addr;
+ else
+ bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_datlen = 0;
bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
/* Set the physical address of the host memory
@@ -656,14 +695,21 @@ static void cpm_uart_initbd(struct uart_
* virtual address for us to work with.
*/
mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
+ dma_addr = (u8*)(pinfo->dma_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize));
bdp = pinfo->tx_cur = pinfo->tx_bd_base;
for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ if (pinfo->dma_addr)
+ bdp->cbd_bufaddr = (ulong)dma_addr;
+ else
+ bdp->cbd_bufaddr = virt_to_bus(mem_addr);
bdp->cbd_sc = BD_SC_INTRPT;
mem_addr += pinfo->tx_fifosize;
+ dma_addr += pinfo->tx_fifosize;
}
-
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ if (pinfo->dma_addr)
+ bdp->cbd_bufaddr = (ulong)dma_addr;
+ else
+ bdp->cbd_bufaddr = virt_to_bus(mem_addr);
bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
}
@@ -763,6 +809,8 @@ static void cpm_uart_init_smc(struct uar
/* Using idle charater time requires some additional tuning. */
up->smc_mrblr = pinfo->rx_fifosize;
up->smc_maxidl = pinfo->rx_fifosize;
+ up->smc_brklen = 0;
+ up->smc_brkec = 0;
up->smc_brkcr = 1;
cpm_line_cr_cmd(line, CPM_CR_INIT_TRX);
@@ -815,6 +863,10 @@ static int cpm_uart_request_port(struct
return ret;
cpm_uart_initbd(pinfo);
+ if (IS_SMC(pinfo))
+ cpm_uart_init_smc(pinfo);
+ else
+ cpm_uart_init_scc(pinfo);
return 0;
}
@@ -902,6 +954,7 @@ struct uart_cpm_port cpm_uart_ports[UART
.rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc1_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
[UART_SCC2] = {
.port = {
@@ -915,6 +968,7 @@ struct uart_cpm_port cpm_uart_ports[UART
.rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc2_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
[UART_SCC3] = {
.port = {
@@ -928,6 +982,7 @@ struct uart_cpm_port cpm_uart_ports[UART
.rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc3_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
[UART_SCC4] = {
.port = {
@@ -941,6 +996,7 @@ struct uart_cpm_port cpm_uart_ports[UART
.rx_nrfifos = RX_NUM_FIFO,
.rx_fifosize = RX_BUF_SIZE,
.set_lineif = scc4_lineif,
+ .wait_closing = SCC_WAIT_CLOSING,
},
};
@@ -1081,6 +1137,7 @@ static int __init cpm_uart_console_setup
return ret;
cpm_uart_initbd(pinfo);
+ cpm_uart_init_scc(pinfo);
if (IS_SMC(pinfo))
cpm_uart_init_smc(pinfo);
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -82,6 +82,16 @@ void cpm_line_cr_cmd(int line, int cmd)
void smc1_lineif(struct uart_cpm_port *pinfo)
{
volatile cpm8xx_t *cp = cpmp;
+
+#if defined (CONFIG_MPC885ADS)
+ /* Enable SMC1 transceivers */
+ {
+ cp->cp_pepar |= 0x000000c0;
+ cp->cp_pedir &= ~0x000000c0;
+ cp->cp_peso &= ~0x00000040;
+ cp->cp_peso |= 0x00000080;
+ }
+#elif defined (CONFIG_MPC86XADS)
unsigned int iobits = 0x000000c0;
if (!pinfo->is_portb) {
@@ -93,41 +103,31 @@ void smc1_lineif(struct uart_cpm_port *p
((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
}
-
-#ifdef CONFIG_MPC885ADS
- /* Enable SMC1 transceivers */
- {
- volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4);
- uint tmp;
-
- tmp = in_be32(bcsr1);
- tmp &= ~BCSR1_RS232EN_1;
- out_be32(bcsr1, tmp);
- iounmap(bcsr1);
- }
#endif
-
pinfo->brg = 1;
}
void smc2_lineif(struct uart_cpm_port *pinfo)
{
-#ifdef CONFIG_MPC885ADS
volatile cpm8xx_t *cp = cpmp;
- volatile uint __iomem *bcsr1;
- uint tmp;
-
+#if defined (CONFIG_MPC885ADS)
cp->cp_pepar |= 0x00000c00;
cp->cp_pedir &= ~0x00000c00;
cp->cp_peso &= ~0x00000400;
cp->cp_peso |= 0x00000800;
+#elif defined (CONFIG_MPC86XADS)
+ unsigned int iobits = 0x00000c00;
+
+ if (!pinfo->is_portb) {
+ cp->cp_pbpar |= iobits;
+ cp->cp_pbdir &= ~iobits;
+ cp->cp_pbodr &= ~iobits;
+ } else {
+ ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits;
+ ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
+ ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
+ }
- /* Enable SMC2 transceivers */
- bcsr1 = ioremap(BCSR1, 4);
- tmp = in_be32(bcsr1);
- tmp &= ~BCSR1_RS232EN_2;
- out_be32(bcsr1, tmp);
- iounmap(bcsr1);
#endif
pinfo->brg = 2;
^ permalink raw reply
* [PATCH] cpm_uart: make dpram allocation actually work
From: Pantelis Antoniou @ 2005-08-02 16:09 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 334 bytes --]
Hi Marcelo
While the idea of allocating console buffers from dpram is sound,
the initial implementation didn't actually work :)
The following patch fixes it (tested and booted on 2.6.13-rc4).
Regards
Pantelis
--------------------------------------------------------------
Signed-Off-By: Pantelis Antoniou <panto@intracom.gr>
[-- Attachment #2: cpm_uart-dpram-fix.patch --]
[-- Type: text/x-diff, Size: 3988 bytes --]
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -70,6 +70,20 @@ static void cpm_uart_initbd(struct uart_
/**************************************************************/
+static inline unsigned long cpu2cpm_addr(void *addr)
+{
+ if ((unsigned long)addr >= CPM_ADDR)
+ return (unsigned long)addr;
+ return virt_to_bus(addr);
+}
+
+static inline void *cpm2cpu_addr(unsigned long addr)
+{
+ if (addr >= CPM_ADDR)
+ return (void *)addr;
+ return bus_to_virt(addr);
+}
+
/*
* Check, if transmit buffers are processed
*/
@@ -243,7 +257,7 @@ static void cpm_uart_int_rx(struct uart_
}
/* get pointer */
- cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr);
+ cp = cpm2cpu_addr(bdp->cbd_bufaddr);
/* loop through the buffer */
while (i-- > 0) {
@@ -569,7 +583,8 @@ static int cpm_uart_tx_pump(struct uart_
/* Pick next descriptor and fill from buffer */
bdp = pinfo->tx_cur;
- p = bus_to_virt(bdp->cbd_bufaddr);
+ p = cpm2cpu_addr(bdp->cbd_bufaddr);
+
*p++ = xmit->buf[xmit->tail];
bdp->cbd_datlen = 1;
bdp->cbd_sc |= BD_SC_READY;
@@ -595,7 +610,7 @@ static int cpm_uart_tx_pump(struct uart_
while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) {
count = 0;
- p = bus_to_virt(bdp->cbd_bufaddr);
+ p = cpm2cpu_addr(bdp->cbd_bufaddr);
while (count < pinfo->tx_fifosize) {
*p++ = xmit->buf[xmit->tail];
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -643,12 +658,12 @@ static void cpm_uart_initbd(struct uart_
mem_addr = pinfo->mem_addr;
bdp = pinfo->rx_cur = pinfo->rx_bd_base;
for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
mem_addr += pinfo->rx_fifosize;
}
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
/* Set the physical address of the host memory
@@ -658,12 +673,12 @@ static void cpm_uart_initbd(struct uart_
mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
bdp = pinfo->tx_cur = pinfo->tx_bd_base;
for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_INTRPT;
mem_addr += pinfo->tx_fifosize;
}
- bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+ bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr);
bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
}
@@ -983,10 +998,7 @@ static void cpm_uart_console_write(struc
* If the buffer address is in the CPM DPRAM, don't
* convert it.
*/
- if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR)
- cp = (unsigned char *) (bdp->cbd_bufaddr);
- else
- cp = bus_to_virt(bdp->cbd_bufaddr);
+ cp = cpm2cpu_addr(bdp->cbd_bufaddr);
*cp = *s;
@@ -1003,10 +1015,7 @@ static void cpm_uart_console_write(struc
while ((bdp->cbd_sc & BD_SC_READY) != 0)
;
- if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR)
- cp = (unsigned char *) (bdp->cbd_bufaddr);
- else
- cp = bus_to_virt(bdp->cbd_bufaddr);
+ cp = cpm2cpu_addr(bdp->cbd_bufaddr);
*cp = 13;
bdp->cbd_datlen = 1;
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -185,6 +185,8 @@ int cpm_uart_allocbuf(struct uart_cpm_po
memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
if (is_con) {
+ /* was hostalloc but changed cause it blows away the */
+ /* large tlb mapping when pinning the kernel area */
mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
dma_addr = 0;
} else
^ permalink raw reply
* MPC8245/1 UARTs and linux-2.6.13-rc5
From: Kumar Gala @ 2005-08-02 13:44 UTC (permalink / raw)
To: linuxppc-embedded Linux list
For all people have issues with the UARTs on MPC8245/1. In the
2.6.13 kernel we reworked the support for UARTs to be platform
devices. If you look at the 2.6.13-rc5 release you will see the
changes that went in. Additionally, the sandpoint reference platform
code was updated to take advantage of the changes.
Hopefully, these changes will make some of the issues you might be
facing less of a problem.
- kumar
^ permalink raw reply
* Re: Serial console
From: Kumar Gala @ 2005-08-02 13:39 UTC (permalink / raw)
To: JohnsonCheng; +Cc: linuxppc-embedded
In-Reply-To: <20050802034517.F3D0167E42@ozlabs.org>
On Aug 1, 2005, at 10:38 PM, JohnsonCheng wrote:
> Dear Daniel,
>
> I also meet this problem on MPC8245 with linux-2.6.12.3, and I =20
> found it uses
> LEVEL for interrupt in sandpoint.c. Do you have any idea for it?
All internal interrupts on the MPC8245/1 should be LEVEL interrupts.
- kumar
> -----Original Message-----
> From: linuxppc-embedded-bounces@ozlabs.org
> [mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Daniel Ann
> Sent: Monday, August 01, 2005 9:27 AM
> To: Anton W=F6llert
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Re: Serial console
>
> Thanks for your input Anton.
> I'm not all that certain about sandpoint platform has its own serial
> driver so I've worked with 8250.c. Anyway, I've got it working now. It
> was problem with interrupt. As soon as I changed interrupt from EGDE
> to LEVEL it began working. Altho I'm faced with yet another problem
> with openpic but I'm digging thru it at the moment.
>
> BTW, I have no idea why EDGE didnt work and LEVEL does.
>
> Cheers,
> Daniel
>
> On 7/30/05, Anton W=F6llert <a.woellert@gmail.com> wrote:
>
>> Daniel Ann wrote:
>>
>>> Hi folks,
>>>
>>> Having all the kernel boot up log on console means that I've done =20=
>>> some
>>> part right. But why am I not getting anything from the user =20
>>> processes
>>> on the console screen ?
>>>
>>> Is there anything I need to do on the kernel config ?
>>>
>>>
>>
>> Hi, we've had the same problem some time ago on a tqm850l =20
>> (mpc850). Our
>> problem was, that we had registered two serial consoles in the kernel
>> config or something like that. we had to disable all serial-driver =20=
>> stuff
>> and enable just the platform-specific serial-console driver. we =20
>> tracked
>> this down with inserting a printk(buf) into the tty_write fs-op of =20=
>> the
>> serial-port driver in drivers/char/tty_io.c. the ttyS0 was used =20
>> but has
>> taken another serial-driver than the platform specific.
>>
>> may this help you :)
>>
>>
>> anton
>>
>>
>
>
> --=20
> Daniel
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
^ permalink raw reply
* Re : MPC8245+2.6.12=oops
From: Sam Song @ 2005-08-02 13:38 UTC (permalink / raw)
To: Carl Ljungmark; +Cc: linuxppc-embedded
In-Reply-To: <op.suvg7mug0c7u6q@clj.sysgo.com>
Carl Ljungmark <carl.ljungmark@sysgo.com> wrote:
> Trying to boot linux 2.6.12 on an MPC8245 board from
> MEN (a12) with MenMon
> firmware. Nothing is printed to the console (ttyS0),
> but the __log_buf contains this:
>
> <4>entering platform_init.
Seems sth wrong on target init configuration. Pls
check some values like MPC10X_MAPB_EUMB_BASE or
UART related stuff like SERIAL_PORT_DFNS. Well, I
just have the successful experience on a MPC8241
target based on SANDPOINT board with 2.6.12-rc2 and
2.6.13-rc3.
In addition, enable early console is also a help to
debug.
Best regards,
Sam
__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
^ permalink raw reply
* Re: MPC8245+2.6.12=oops
From: Kumar Gala @ 2005-08-02 13:24 UTC (permalink / raw)
To: Carl Ljungmark; +Cc: linuxppc-embedded
In-Reply-To: <op.suvg7mug0c7u6q@clj.sysgo.com>
This looks like an issue with the MEN port. without that code its
difficult to comment on what exactly may be wrong.
- kumar
On Aug 2, 2005, at 3:44 AM, Carl Ljungmark wrote:
> Hello everyone!
> Trying to boot linux 2.6.12 on an MPC8245 board from MEN (a12) with
> MenMon
> firmware. Nothing is printed to the console (ttyS0), but the __log_buf
> contains this:
>
> <4>entering platform_init.
> <4>MENMON parameter string: MPAR brd=A012a brdrev=01.04.00 brdmod=00
> sernbr=74 cbr=38400 cons=COM1 mem0=262144 cpu=MPC8245
> cpuclk=250memclk=100
> vmeirqenb=FEclun=02dlun=00 mm=smm
> MMST=_00+_12+_1B+_1C+_0C+_17+_1A+_1D+_1E-SPD+RTC+LM75+WDOG+CHKS+ALL+.
> <4>Command line now console=ttyS0,38400.
> <4>Using memory size from MENMON 0x10000000.
> <3>Non-recoverable exception at PC=c0007af0 MSR=b930.
> <4>Oops: nonrecoverable exception,sig: 9 [#1].
> <4>NIP: C0007AF0 LR:C000E474 SP: C00F7F70 REGS: c00f7ec0 TRAP: 0600
> Not
> tainted.
> <4>MSR: 0000b930 EE: 1 PR: 0 FP:1 ME: 1 IR/DR:11.
> <4>DAR: C0138000, DSISR: 00017C00.
> <4>TASK = c00dda10[0] 'swapper' THREAD: c00f6000.
> <4>Last syscall: 0 .
> <6>GPR00: 00000080 C00F7F70 C00DDA10 C0138000 0000000000001000
> 00000001
> 00000001 .
> <6>GPR08: 0000000200000000 00000001 00000000 00000000 00000000
> 00008081
> 2A090A86 .
> <6>GPR16: 10588403 1E21D063 21218986 50022502 3C0185B8
> 011368CA00FFF010
> 00FFF024 .
> <6>GPR24: 00000000 01F8FA68 40000000 C00DC000000005A9 FD000000
> FD000000
> C0138000 .
> <4>NIP [c0007af0] clear_pages+0x10/0x1c.
> <4>LR [c000e474] pte_alloc_one_kernel+0x60/0x78.
> <4>Call trace:.
> <4> [c003e948] pte_alloc_kernel+0x54/0x84.
> <4> [c000e5e4] map_page+0x3c/0xdc.
> <4> [c00ff61c] io_block_mapping+0x78/0xdc.
> <4> [c00fe560] men824xali_map_io+0x20/0x44.
> <4> [c00fec38] MMU_init+0x194/0x204.
> <4> [c00032a4]start_here+0x48/0x80.
> 0>Kernelpanic - not syncing: Attempted to kill the idletask!.
> <4> ......
>
> adding 'nobats' to the command line changes the boot output
> slightly (I
> then get two oops).
>
> In order to get the whole output I had to turn off caching, maybe
> this has
> influenced the boot process.. with dcache on, the __log_buf is
> practically
> empty.
>
> Has anyone managed to boot 6.12 on this board successfully?
>
> Thanks in advance,
> Carl.
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
^ permalink raw reply
* Re: ??: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: Wolfgang Denk @ 2005-08-02 12:16 UTC (permalink / raw)
To: FCG WANG Baohua; +Cc: linuxppc-embedded
In-Reply-To: <A9DE2BAF233E444FA9C5E77A5825A01E865051@ydmail.sbell.com.cn>
In message <A9DE2BAF233E444FA9C5E77A5825A01E865051@ydmail.sbell.com.cn> you wrote:
> >
> The magic number is right when using vmlinux.UBoot instead of vmlinux
> or zImage, Why?
Because vmlinux.UBoot is a correct U-Boot image, while vmlinux and
zImage are not. Read the documentation.
> Another question puzzle me:
> The kernel print the "Transferring control to Linux (at address
> 00000000) ... " then halt ,no any response from serial port.
Read the documentation. This is a FAQ.
> How to not print the "Transferring control to Linux (at address
> 00000000) ... " ? Is it right ?
Yes, this is correct.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Punishment becomes ineffective after a certain point. Men become in-
sensitive.
-- Eneg, "Patterns of Force", stardate 2534.7
^ permalink raw reply
* A PPC kernel issue with UART ??
From: JohnsonCheng @ 2005-08-02 11:41 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 790 bytes --]
Dear All,
I meet a wired UART problem on linux-2.6 with MPC8241 chip.
My Environment is as following:
CPU: MPC8241
Linux: 2.6.12.3
COM1 offset: 0x4500, COM2 offset: 0x4600
When I booting my rootfs, it hangs at following message:
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 104k init
EXT2-fs warning: checktime reached, running e2fsck is recommended
I had add printk in tty_write() of drivers/char/tty_io.c, the message from
rootfs have printed.
The conclusion is that message can be printed by printk() in linux kernel,
but can't be printed by printf() in user mode. I think it must be something
wrong for my UART configurations, does anybody know it??
Best Regards,
Johnson Cheng
[-- Attachment #2: Type: text/html, Size: 5274 bytes --]
^ permalink raw reply
* [PATCH] fix asm-ppc/dma-mapping.h sparse warning
From: Christoph Hellwig @ 2005-08-02 9:56 UTC (permalink / raw)
To: paulus, akpm; +Cc: linuxppc-dev
GFP flags must be passed as unisgned int __nocast these days, else we'll get
tons of sparse warnings in every driver.
Index: linux-2.6/include/asm-ppc/dma-mapping.h
===================================================================
--- linux-2.6.orig/include/asm-ppc/dma-mapping.h 2005-07-28 19:32:32.000000000 +0200
+++ linux-2.6/include/asm-ppc/dma-mapping.h 2005-07-31 16:22:20.000000000 +0200
@@ -60,7 +60,8 @@
}
static inline void *dma_alloc_coherent(struct device *dev, size_t size,
- dma_addr_t * dma_handle, int gfp)
+ dma_addr_t * dma_handle,
+ unsigned int __nocast gfp)
{
#ifdef CONFIG_NOT_COHERENT_CACHE
return __dma_alloc_coherent(size, dma_handle, gfp);
^ permalink raw reply
* [PATCH] fix gcc4 warning in asm-ppc/time.h
From: Christoph Hellwig @ 2005-08-02 9:55 UTC (permalink / raw)
To: paulus, akpm; +Cc: linuxppc-dev
A function must not return a const value, instead use
__attribute_const__.
Index: linux-2.6/include/asm/time.h
===================================================================
--- linux-2.6.orig/include/asm/time.h 2005-04-30 10:17:19.000000000 +0200
+++ linux-2.6/include/asm/time.h 2005-08-01 11:57:12.000000000 +0200
@@ -10,6 +10,7 @@
#define __ASM_TIME_H__
#include <linux/config.h>
+#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/rtc.h>
#include <linux/threads.h>
@@ -58,7 +59,7 @@
/* Accessor functions for the timebase (RTC on 601) registers. */
/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
#ifdef CONFIG_6xx
-extern __inline__ int const __USE_RTC(void) {
+extern __inline__ int __attribute_const__ __USE_RTC(void) {
return (mfspr(SPRN_PVR)>>16) == 1;
}
#else
^ permalink raw reply
* Re: PPC860 board and PPCBoot "verifying Checksum ... Bad Data CRC"
From: Alex Zeffertt @ 2005-08-02 8:47 UTC (permalink / raw)
To: FCG WANG Baohua; +Cc: Linuxppc-embedded
In-Reply-To: <A9DE2BAF233E444FA9C5E77A5825A01E8652FB@ydmail.sbell.com.cn>
On Tue, 2 Aug 2005 11:26:30 +0800
"FCG WANG Baohua" <Baohua.WANG@alcatel-sbell.com.cn> wrote:
> Dear All:
> I build the ELDK3.1.1 kernel 2.4.25, When bootm or "imi" it shows the "verifying Checksum ...
> Bad Data CRC", then stop.
> But the vmlinux.UBoot is right in Host, How can I do? I use tftpboot to download it.
> Thanks!
>
You may have a RAM error. Try running mtest in uboot. (And make sure CFG_MEMTEST_START and
CFG_MEMTEST_END cover the region to which you are downloading uImage.)
Alex
^ permalink raw reply
* MPC8245+2.6.12=oops
From: Carl Ljungmark @ 2005-08-02 8:44 UTC (permalink / raw)
To: linuxppc-embedded
Hello everyone!
Trying to boot linux 2.6.12 on an MPC8245 board from MEN (a12) with MenMo=
n =20
firmware. Nothing is printed to the console (ttyS0), but the __log_buf =20
contains this:
<4>entering platform_init.
<4>MENMON parameter string: MPAR brd=3DA012a brdrev=3D01.04.00 brdmod=3D0=
0 =20
sernbr=3D74 cbr=3D38400 cons=3DCOM1 mem0=3D262144 cpu=3DMPC8245 cpuclk=3D=
250memclk=3D100 =20
vmeirqenb=3DFEclun=3D02dlun=3D00 mm=3Dsmm =20
MMST=3D_00+_12+_1B+_1C+_0C+_17+_1A+_1D+_1E-SPD+RTC+LM75+WDOG+CHKS+ALL+.
<4>Command line now console=3DttyS0,38400.
<4>Using memory size from MENMON 0x10000000.
<3>Non-recoverable exception at PC=3Dc0007af0 MSR=3Db930.
<4>Oops: nonrecoverable exception,sig: 9 [#1].
<4>NIP: C0007AF0 LR:C000E474 SP: C00F7F70 REGS: c00f7ec0 TRAP: 0600 Not =20
tainted.
<4>MSR: 0000b930 EE: 1 PR: 0 FP:1 ME: 1 IR/DR:11.
<4>DAR: C0138000, DSISR: 00017C00.
<4>TASK =3D c00dda10[0] 'swapper' THREAD: c00f6000.
<4>Last syscall: 0 .
<6>GPR00: 00000080 C00F7F70 C00DDA10 C0138000 0000000000001000 00000001 =20
00000001 .
<6>GPR08: 0000000200000000 00000001 00000000 00000000 00000000 00008081 =20
2A090A86 .
<6>GPR16: 10588403 1E21D063 21218986 50022502 3C0185B8 011368CA00FFF010 =20
00FFF024 .
<6>GPR24: 00000000 01F8FA68 40000000 C00DC000000005A9 FD000000 FD000000 =20
C0138000 .
<4>NIP [c0007af0] clear_pages+0x10/0x1c.
<4>LR [c000e474] pte_alloc_one_kernel+0x60/0x78.
<4>Call trace:.
<4> [c003e948] pte_alloc_kernel+0x54/0x84.
<4> [c000e5e4] map_page+0x3c/0xdc.
<4> [c00ff61c] io_block_mapping+0x78/0xdc.
<4> [c00fe560] men824xali_map_io+0x20/0x44.
<4> [c00fec38] MMU_init+0x194/0x204.
<4> [c00032a4]start_here+0x48/0x80.
0>Kernelpanic - not syncing: Attempted to kill the idletask!.
<4> ......
adding 'nobats' to the command line changes the boot output slightly (I =20
then get two oops).
In order to get the whole output I had to turn off caching, maybe this ha=
s =20
influenced the boot process.. with dcache on, the __log_buf is practicall=
y =20
empty.
Has anyone managed to boot 6.12 on this board successfully?
Thanks in advance,
Carl.
^ permalink raw reply
* AW: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: David Grab @ 2005-08-02 8:08 UTC (permalink / raw)
To: 'FCG WANG Baohua'; +Cc: linuxppc-embedded
In-Reply-To: <A9DE2BAF233E444FA9C5E77A5825A01E865051@ydmail.sbell.com.cn>
[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]
>Dear Denk:
> The magic number is right when using vmlinux.UBoot instead of vmlinux or
zImage, Why?
u-boot needs an u-boot image. Wolfgang did already say that vmlinux.UBoot is
that image. So use this image and nothing else. Also read the manual
especially this chapter
http://www.denx.de/twiki/bin/view/DULG/BootingEmbeddedLinux
> Another question puzzle me:
> The kernel print the "Transferring control to Linux (at address 00000000)
... " then halt ,no any response
> from serial port.
Seems for me that the serial configuration did not match. Are you sure you
chosen and cofigured the right UART? If so then debug with BDI2000.
> I tried ramdiak and nfs, there are the same result.
> So why not print the
> "Linux version 2.4.25 (root at FedoraCore2) (gcc version 3.3.3 (DENX ELDK
3.1
>3.3.3-8)) #94 Tue Jul 5 18:59:08 PDT 2005"
The console output has nothing to do with ramdisk or nfs. So check your
configuration of the active console. An quick check, if your u-boot did not
pass the console parameters is to set the console parameter in linux. For
that you have to activate command line to yes and set the command line
parameter to 'console=ttySx'. x=0 is UART0 and x=1 is UART1. If this not
help then debug again with BDI.
> How to not print the "Transferring control to Linux (at address 00000000)
... " ? Is it right ?
> Thanks a lot!
This print might be ok.
Best regards,
David
[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 2328 bytes --]
^ permalink raw reply
* ??: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: FCG WANG Baohua @ 2005-08-02 7:29 UTC (permalink / raw)
To: wd; +Cc: linuxppc-embedded
Dear Denk:
The magic number is right when using vmlinux.UBoot instead of vmlinux =
or zImage, Why?
Another question puzzle me:
The kernel print the "Transferring control to Linux (at address =
00000000) ... " then halt ,no any response from serial port.
I tried ramdiak and nfs, there are the same result.
So why not print the=20
"Linux version 2.4.25 (root at FedoraCore2) (gcc version 3.3.3 (DENX =
ELDK 3.1
3.3.3-8)) #94 Tue Jul 5 18:59:08 PDT 2005"=20
=20
How to not print the "Transferring control to Linux (at address =
00000000) ... " ? Is it right ?=20
Thanks a lot!
-----????-----
???: wd@denx.de [mailto:wd@denx.de]
????: 2005?8?2? 15:13
???: FCG WANG Baohua
??: linuxppc-embedded@ozlabs.org
??: Re: Bad Magic Number when boot linux kernel with ppcboot (PPC860 =
board)=20
In message <A9DE2BAF233E444FA9C5E77A5825A01E8652F9@ydmail.sbell.com.cn> =
you wrote:
>=20
> kernel, after I loaded it print the following messages:
>=20
> =3D> bootm 0x180000
> ## Booting image at 00000000 ...
> Bad Magic Number
> =3D>
Which address did you load the image to?
> How to slove it, thanks a lot!
> I use: zImage,=20
> vmlinux.UBoot,
> vmlinux=20
> it all print the same messages, How can I do?=20
Please read the documentation. Only uImage =3D vmlinux.UBoot can work.
Best regards,
Wolfgang Denk
--=20
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"Confound these ancestors.... They've stolen our best ideas!"
- Ben Jonson
^ permalink raw reply
* Re: serial console no response after print "Transferring control to Linux (at address 00000000)" on PPC860
From: Wolfgang Denk @ 2005-08-02 7:18 UTC (permalink / raw)
To: FCG WANG Baohua; +Cc: linuxppc-embedded
In-Reply-To: <A9DE2BAF233E444FA9C5E77A5825A01E8652FD@ydmail.sbell.com.cn>
In message <A9DE2BAF233E444FA9C5E77A5825A01E8652FD@ydmail.sbell.com.cn> you wrote:
>
> I use ppcboot and ELDK 3.1.1 kernel 2.4.25 to boot a PPC860 board, I
> select the ttyS0, 9600, root=/de/ram during config the kernel.
> I select the SMC1,SMC2 device too.
> But when bootm 180000, it print the "Transferring control to Linux (at
> address 00000000)" then halt.
> How can I do? Tell me the detail when config the kernel, thanks!
After all the questions you posted to the mailing list I want to give
two recommendations:
* Please continue to try things for a while (dasy a day or so) before
posting. This will avoid a lot of unnecessary postings.
* Please do yourself (and us) a favour and read the documentation,
especially the FAQ section of the DULG. If you already read it,
then read it agaion, carefully.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
You may call me by my name, Wirth, or by my value, Worth.
- Nicklaus Wirth
^ permalink raw reply
* Re: Reply: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: Wolfgang Denk @ 2005-08-02 7:15 UTC (permalink / raw)
To: FCG WANG Baohua; +Cc: linuxppc-embedded
In-Reply-To: <A9DE2BAF233E444FA9C5E77A5825A01E8652FA@ydmail.sbell.com.cn>
In message <A9DE2BAF233E444FA9C5E77A5825A01E8652FA@ydmail.sbell.com.cn> you wrote:
>
> => bootm 0x180000
> ## Booting image at 00000000 ...
> Bad Magic Number
> =>
The funny thing is that you seem to enter "0x180000" but the address
printed is 00000000. make sure you have no funny characters or
control keys in this number. Re-type it carefully. Omit the "0x"
part, i. e. try a plain "bootm 180000'
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Brontosaurus Principle: Organizations can grow faster than their
brains can manage them in relation to their environment and to their
own physiology: when this occurs, they are an endangered species.
- Thomas K. Connellan
^ permalink raw reply
* Re: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: Wolfgang Denk @ 2005-08-02 7:12 UTC (permalink / raw)
To: FCG WANG Baohua; +Cc: linuxppc-embedded
In-Reply-To: <A9DE2BAF233E444FA9C5E77A5825A01E8652F9@ydmail.sbell.com.cn>
In message <A9DE2BAF233E444FA9C5E77A5825A01E8652F9@ydmail.sbell.com.cn> you wrote:
>
> kernel, after I loaded it print the following messages:
>
> => bootm 0x180000
> ## Booting image at 00000000 ...
> Bad Magic Number
> =>
Which address did you load the image to?
> How to slove it, thanks a lot!
> I use: zImage,
> vmlinux.UBoot,
> vmlinux
> it all print the same messages, How can I do?
Please read the documentation. Only uImage = vmlinux.UBoot can work.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"Confound these ancestors.... They've stolen our best ideas!"
- Ben Jonson
^ permalink raw reply
* serial console no response after print "Transferring control to Linux (at address 00000000)" on PPC860
From: FCG WANG Baohua @ 2005-08-02 4:52 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
Dear All:
I use ppcboot and ELDK 3.1.1 kernel 2.4.25 to boot a PPC860 board, I select the ttyS0, 9600, root=/de/ram during config the kernel.
I select the SMC1,SMC2 device too.
But when bootm 180000, it print the "Transferring control to Linux (at address 00000000)" then halt.
How can I do? Tell me the detail when config the kernel, thanks!
[-- Attachment #2: Type: text/html, Size: 1228 bytes --]
^ permalink raw reply
* RE: Serial console
From: JohnsonCheng @ 2005-08-02 3:38 UTC (permalink / raw)
To: 'Daniel Ann', 'Anton Wöllert'; +Cc: linuxppc-embedded
In-Reply-To: <9b7ca65705073118276e89b29@mail.gmail.com>
Dear Daniel,
I also meet this problem on MPC8245 with linux-2.6.12.3, and I found it =
uses
LEVEL for interrupt in sandpoint.c. Do you have any idea for it?
Thanks,
Johnson Cheng
-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of Daniel Ann
Sent: Monday, August 01, 2005 9:27 AM
To: Anton W=F6llert
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Serial console
Thanks for your input Anton.
I'm not all that certain about sandpoint platform has its own serial
driver so I've worked with 8250.c. Anyway, I've got it working now. It
was problem with interrupt. As soon as I changed interrupt from EGDE
to LEVEL it began working. Altho I'm faced with yet another problem
with openpic but I'm digging thru it at the moment.
BTW, I have no idea why EDGE didnt work and LEVEL does.
Cheers,
Daniel
On 7/30/05, Anton W=F6llert <a.woellert@gmail.com> wrote:
> Daniel Ann wrote:
> > Hi folks,
> >
> > Having all the kernel boot up log on console means that I've done =
some
> > part right. But why am I not getting anything from the user =
processes
> > on the console screen ?
> >
> > Is there anything I need to do on the kernel config ?
> >
>=20
> Hi, we've had the same problem some time ago on a tqm850l (mpc850). =
Our
> problem was, that we had registered two serial consoles in the kernel
> config or something like that. we had to disable all serial-driver =
stuff
> and enable just the platform-specific serial-console driver. we =
tracked
> this down with inserting a printk(buf) into the tty_write fs-op of the
> serial-port driver in drivers/char/tty_io.c. the ttyS0 was used but =
has
> taken another serial-driver than the platform specific.
>=20
> may this help you :)
>=20
>=20
> anton
>=20
--=20
Daniel
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* 答复: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: FCG WANG Baohua @ 2005-08-02 3:28 UTC (permalink / raw)
To: Debora Liu; +Cc: Linuxppc-embedded
Dear Mr Liu:
I have corrected it, Now another question:
when bootm or imi , it shows the "Verifying Checksum ... Bad Data CRC", =
But I checked the vmlinux.UBoot on host, it is right,
I download it using TFTP, How can I slove it? Thanks!
-----=D4=AD=CA=BC=D3=CA=BC=FE-----
=B7=A2=BC=FE=C8=CB: Debora Liu [mailto:deboralh@fel.com.cn]
=B7=A2=CB=CD=CA=B1=BC=E4: 2005=C4=EA8=D4=C22=C8=D5 11:17
=CA=D5=BC=FE=C8=CB: FCG WANG Baohua
=B3=AD=CB=CD: Linuxppc-embedded
=D6=F7=CC=E2: Re: Bad Magic Number when boot linux kernel with ppcboot =
(PPC860
board)
Hello, FCG WANG Baohua
In message <2005-08-02 10:08:35 Baohua.WANG@alcatel-sbell.com.cn> you =
wrote:
>Dear All:
> I use a PPC860 board and ELDK 3.1.1 (kernel 2.4.25) to boot the linux =
kernel, after I loaded it print the following messages:
>
>=3D> bootm 0x180000
>## Booting image at 00000000 ...
>Bad Magic Number
>=3D>
Please check your boot load image address.
=20
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1Debora Liu
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1deboralh@fel.com.cn
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12005-08-02
^ permalink raw reply
* PPC860 board and PPCBoot "verifying Checksum ... Bad Data CRC"
From: FCG WANG Baohua @ 2005-08-02 3:26 UTC (permalink / raw)
To: wd; +Cc: Linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
Dear All:
I build the ELDK3.1.1 kernel 2.4.25, When bootm or "imi" it shows the "verifying Checksum ... Bad Data CRC", then stop.
But the vmlinux.UBoot is right in Host, How can I do? I use tftpboot to download it.
Thanks!
[-- Attachment #2: Type: text/html, Size: 922 bytes --]
^ permalink raw reply
* Re: Bad Magic Number when boot linux kernel with ppcboot (PPC860 board)
From: Debora Liu @ 2005-08-02 3:17 UTC (permalink / raw)
To: FCG WANG Baohua; +Cc: Linuxppc-embedded
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 463 bytes --]
Hello, FCG WANG Baohua
In message <2005-08-02 10:08:35 Baohua.WANG@alcatel-sbell.com.cn> you wrote:
>Dear All:
> I use a PPC860 board and ELDK 3.1.1 (kernel 2.4.25) to boot the linux kernel, after I loaded it print the following messages:
>
>=> bootm 0x180000
>## Booting image at 00000000 ...
>Bad Magic Number
>=>
Please check your boot load image address.
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Debora Liu
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡deboralh@fel.com.cn
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2005-08-02
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox