linux-mips
[Top] [All Lists]

Re: [PATCH 07/14] MIPS: Loongson 3: Add serial port support.

To: Arnaud Patard <arnaud.patard@rtp-net.org>
Subject: Re: [PATCH 07/14] MIPS: Loongson 3: Add serial port support.
From: huacai chen <chenhuacai@gmail.com>
Date: Fri, 15 Jun 2012 19:44:54 +0800
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>, Zhangjin Wu <wuzhangjin@gmail.com>, Huacai Chen <chenhc@lemote.com>, Hongliang Tao <taohl@lemote.com>, Hua Yan <yanh@lemote.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=lsj06Fb4dUBtAd1JxIVUmELuKYGWCY6HdtQBD79Y+e8=; b=PYfaJxtEcWxIrMgAinF4yRhlPcx9qr6SxV+Nen+6SSJyfibAVjWQS+SQVYPqH7RotY A5C/05pztdhXNaSKy5BzFir4yfe7XX2oQw9ZVzIlUX5X12KJkd+t7+K3MRUav2P5hBSF 7NZABqWdnmmlZI/nAlg24b7sMtkWqBpwwmF8Qruy9nIxmUve5b+IotoD21WALyrRJ+zP iA160DF7chQnpOJBm+lpqPpc3p5ShDzlnF5XfieBJHVR4YRImGnWv3fM2IEeg5MgYj3t FlECUCJOEexdQ1PvWIw8sS/LlUE4E/IhiTh6+Wky73CYM3nGYxS8xrlE4lUPhNi5+3qP 4HPw==
In-reply-to: <87aa04x5rz.fsf@lebrac.rtp-net.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1339747801-28691-1-git-send-email-chenhc@lemote.com> <1339747801-28691-8-git-send-email-chenhc@lemote.com> <87aa04x5rz.fsf@lebrac.rtp-net.org>
Sender: linux-mips-bounce@linux-mips.org
Thank you, I'll follow your tips.

On Fri, Jun 15, 2012 at 5:50 PM, Arnaud Patard
<arnaud.patard@rtp-net.org> wrote:
> Huacai Chen <chenhuacai@gmail.com> writes:
>
>> Signed-off-by: Huacai Chen <chenhc@lemote.com>
>> Signed-off-by: Hongliang Tao <taohl@lemote.com>
>> Signed-off-by: Hua Yan <yanh@lemote.com>
>> ---
>>  arch/mips/include/asm/mach-loongson/loongson.h |    3 ++
>>  arch/mips/loongson/common/serial.c             |   27 
>> ++++++++++++++++++++++++
>>  arch/mips/loongson/common/uart_base.c          |    5 ++++
>>  3 files changed, 35 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/mips/include/asm/mach-loongson/loongson.h 
>> b/arch/mips/include/asm/mach-loongson/loongson.h
>> index fe7d9a6..16d0924 100644
>> --- a/arch/mips/include/asm/mach-loongson/loongson.h
>> +++ b/arch/mips/include/asm/mach-loongson/loongson.h
>> @@ -125,6 +125,9 @@ static inline void do_perfcnt_IRQ(void)
>>  #define LOONGSON_PCICONFIGBASE       0x00
>>  #define LOONGSON_REGBASE     0x100
>>
>> +/* Loongson-3A cpu uart */
>> +#define LOONGSON_UART_BASE 0x1fe001e0
>
> hm. if it's loongson3 specifique, why is it called like this and not
> LOONGSON3_UART_BASE ?
> Moreover, from a quick look, why don't you define it later in the file
> with the proper macros, say:
>
> #define LOONGSON3_UART_BASE     LOONGSON_REG(LOONGSON_REGBASE + 0xe0)
>
>
>> +
>>  /* PCI Configuration Registers */
>>
>>  #define LOONGSON_PCI_REG(x)  LOONGSON_REG(LOONGSON_PCICONFIGBASE + (x))
>> diff --git a/arch/mips/loongson/common/serial.c 
>> b/arch/mips/loongson/common/serial.c
>> index 7580873..6bfe9dd 100644
>> --- a/arch/mips/loongson/common/serial.c
>> +++ b/arch/mips/loongson/common/serial.c
>> @@ -47,6 +47,33 @@ static struct plat_serial8250_port uart8250_data[][2] = {
>>       [MACH_DEXXON_GDIUM2F10]         {PORT_M(3), {} },
>>       [MACH_LEMOTE_NAS]               {PORT_M(3), {} },
>>       [MACH_LEMOTE_LL2F]              {PORT(3), {} },
>> +     [MACH_LEMOTE_A1004]             {
>> +                                             {
>> +                                                     .irq            = 
>> MIPS_CPU_IRQ_BASE + 2,
>> +                                                     .uartclk        = 
>> 33177600,
>> +                                                     .iotype         = 
>> UPIO_MEM,
>> +                                                     .flags          = 
>> UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
>> +                                             },
>> +                                             {}
>> +                                     },
>> +     [MACH_LEMOTE_A1101]             {
>> +                                             {
>> +                                                     .irq            = 
>> MIPS_CPU_IRQ_BASE + 2,
>> +                                                     .uartclk        = 
>> 25000000,
>> +                                                     .iotype         = 
>> UPIO_MEM,
>> +                                                     .flags          = 
>> UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
>> +                                             },
>> +                                             {}
>> +                                     },
>> +     [MACH_LEMOTE_A1205]             {
>> +                                             {
>> +                                                     .irq            = 
>> MIPS_CPU_IRQ_BASE + 2,
>> +                                                     .uartclk        = 
>> 25000000,
>> +                                                     .iotype         = 
>> UPIO_MEM,
>> +                                                     .flags          = 
>> UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
>> +                                             },
>> +                                             {}
>> +                                     },
>>       [MACH_LOONGSON_END]             {},
>
> What about modifying PORT_M to makes things clearer ?
>
> Arnaud
<Prev in Thread] Current Thread [Next in Thread>