linux-mips
[Top] [All Lists]

Re: [PATCH V3 2/5] MIPS: Add board support for Loongson1B

To: keguang.zhang@gmail.com
Subject: Re: [PATCH V3 2/5] MIPS: Add board support for Loongson1B
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 17 Nov 2011 12:36:09 +0000
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, zhzhl555@gmail.com, peppe.cavallaro@st.com, wuzhangjin@gmail.com, r0bertz@gentoo.org
In-reply-to: <1321522748-21391-2-git-send-email-keguang.zhang@gmail.com>
References: <1321522748-21391-1-git-send-email-keguang.zhang@gmail.com> <1321522748-21391-2-git-send-email-keguang.zhang@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Nov 17, 2011 at 05:39:05PM +0800, keguang.zhang@gmail.com wrote:

> diff --git a/arch/mips/include/asm/mach-loongson1/regs-clk.h 
> b/arch/mips/include/asm/mach-loongson1/regs-clk.h
> new file mode 100644
> index 0000000..4f488c3
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-loongson1/regs-clk.h
> @@ -0,0 +1,32 @@
> +/*
> + * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
> + *
> + * Loongson1 Clock Register Definitions.
> + *
> + * 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 the
> + * Free Software Foundation;  either version 2 of the  License, or (at your
> + * option) any later version.
> + */
> +
> +#ifndef __ASM_MACH_LOONGSON1_REGS_CLK_H
> +#define __ASM_MACH_LOONGSON1_REGS_CLK_H
> +
> +#define LS1X_CLK_REG(x)              (ioremap(LS1X_CLK_BASE + (x), 4))

Uhh...  Don't make assumptions on the MIPS implementation.  Normally
ioremap() consumes some virtual address space and memory for each
invocation.  And eventually io mappings should be freed again with
iounmap.

> +static void ls1x_halt(void)
> +{
> +     pr_notice("\n\n** You can safely turn off the power now **\n\n");

This is so Windows 95 ;-)

Please remove this message.  Messages to a user should be printed by
userspace, most likely an init script.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>