[PATCH] CPM_UART: Fixed SMC handling for CPM2 processors

Vitaly Bordug vbordug at ru.mvista.com
Tue Feb 13 04:55:00 EST 2007


On Mon, 12 Feb 2007 11:33:42 +0100
Heiko Schocher <hs at denx.de> wrote:

> Hello Vitaly,
> 
> I tried the Patch from Kalle Pokki
> http://ozlabs.org/pipermail/linuxppc-embedded/2006-November/025108.html
> 
> but my SMC didnt work, without this patch, it works fine. I think that
> the pram_base must be set the follwing way:
> 
Thanks for the patch, but I guess it requires a bit of investigation first since 
we cannot just drop ioremapped offset and get back to raw one that has been returned by 
platform_get_....

We require ioremap stuff for powerpc approach, and I think we'd have to figure out why 
ioremapped address did not satisfy smc (and I'll try on my 8xx).

Guessing we are speaking about arch/ppc/ domain upper...

> diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c
> b/drivers/serial/cpm_uart/cpm_uart_core.c
> index ea85f6a..76ab6e5 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
> @@ -1025,6 +1025,7 @@ int cpm_uart_drv_get_platform_data(struct
> platform_device *pdev, int is_con)
>  	struct uart_cpm_port *pinfo;
>  	int line;
>  	u32 mem, pram, pram_base;
> +	int	base;
>  
>  	idx = pdata->fs_no = fs_uart_get_id(pdata);
>  
> @@ -1050,11 +1051,12 @@ int cpm_uart_drv_get_platform_data(struct
> platform_device *pdev, int is_con)
>  	if (!(r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram")))
>  		return -EINVAL;
>  	pram = (u32)ioremap(r->start, r->end - r->start + 1);
> -
> +	base = r->start;
> +	
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram_base");
>  	if (r) {
>  		pram_base = r->start;
> -		out_be16((u16 *)pram_base, pram & 0xffff);
> +		out_be16((u16 *)pram_base, base & 0xffff);
>  	}
>  
>  	if(idx > fsid_smc2_uart) {
> 
> 
> with this patch it works fine :-)
> 
> Best regards
> Heiko
> 
> -- 
> DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
> Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
> 


-- 
Sincerely, 
Vitaly



More information about the Linuxppc-embedded mailing list