[PATCH 01/02] ARM: shmobile: Introduce r8a7790_read_mode_pins()

Sergei Shtylyov sergei.shtylyov at cogentembedded.com
Tue Jul 9 08:57:09 EDT 2013


Hello.

On 09-07-2013 16:50, Magnus Damm wrote:

> From: Magnus Damm <damm at opensource.se>

> Break out the r8a7790 boot mode code into a separate
> function so it can be shared by multiple users.

> Signed-off-by: Magnus Damm <damm at opensource.se>
> ---

[...]

> --- 0001/arch/arm/mach-shmobile/setup-r8a7790.c
> +++ work/arch/arm/mach-shmobile/setup-r8a7790.c	2013-07-09 19:59:37.000000000 +0900
> @@ -201,6 +201,20 @@ void __init r8a7790_add_standard_devices
>   	r8a7790_register_thermal();
>   }
>
> +#define MODEMR 0xe6160060
> +
> +u32 __init r8a7790_read_mode_pins(void)
> +{
> +	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);

    Why ioremap the whole page if you only need 4 bytes, and the address 
is not aligned to page?

> +	u32 mode;
> +
> +	BUG_ON(!modemr);
> +	mode = ioread32(modemr);
> +	iounmap(modemr);
> +
> +	return mode;
> +}
> +

WBR, Sergei




More information about the linux-arm-kernel mailing list