| To: | Sergei Shtylyov <sshtylyov@mvista.com> |
|---|---|
| Subject: | Re: [PATCH 1/3] MIPS: Alchemy: db1200: improve PB1200 detection. |
| From: | Manuel Lauss <manuel.lauss@googlemail.com> |
| Date: | Thu, 17 Nov 2011 12:59:39 +0100 |
| Cc: | Ralf Baechle <ralf@linux-mips.org>, Linux-MIPS <linux-mips@linux-mips.org> |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=WMrES2puG+cXz7EuRgRhxSI+xc6yJ3U9hpClOtSCncI=; b=uhKvyuseexeFThqjktmFQYbpGdFO4Mkmy7CqNbG6k0Kt55w2o8rn2wWtqJxwLUTa5+ 5+LtkKBGKKB0dJ9v0YsBILAjdA1pSVovBInOt1gMZLtT8D5eVEMy8m9heZGWAJ56BYIs Vj4mnBexLJBKUD08EPGdIc1wVMfpBIojpC2FY= |
| In-reply-to: | <4EC4F470.4090605@mvista.com> |
| References: | <1321458148-7894-1-git-send-email-manuel.lauss@googlemail.com> <4EC4F470.4090605@mvista.com> |
| Sender: | linux-mips-bounce@linux-mips.org |
On Thu, Nov 17, 2011 at 12:48 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>> diff --git a/arch/mips/alchemy/devboards/db1200.c
>> b/arch/mips/alchemy/devboards/db1200.c
>> index 1181241..6721991 100644
>> --- a/arch/mips/alchemy/devboards/db1200.c
>> +++ b/arch/mips/alchemy/devboards/db1200.c
>> @@ -66,19 +66,33 @@ static int __init detect_board(void)
>> {
>> int bid;
>>
>> - /* try the PB1200 first */
>> + /* try the DB1200 first */
>> + bcsr_init(DB1200_BCSR_PHYS_ADDR,
>> + DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS);
>> + if (BCSR_WHOAMI_DB1200 ==
>> BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
>> + unsigned short t = bcsr_read(BCSR_HEXLEDS);
>> + bcsr_write(BCSR_HEXLEDS, ~t);
>> + if (bcsr_read(BCSR_HEXLEDS) != t) {
>> + bcsr_write(BCSR_HEXLEDS, t);
>> + return 0;
>> + }
>> + }
>> +
>> + /* okay, try the PB1200 then */
>> bcsr_init(PB1200_BCSR_PHYS_ADDR,
>> PB1200_BCSR_PHYS_ADDR + PB1200_BCSR_HEXLED_OFS);
>> bid = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
>> if ((bid == BCSR_WHOAMI_PB1200_DDR1) ||
>> - (bid == BCSR_WHOAMI_PB1200_DDR2))
>> - return 0;
>> + (bid == BCSR_WHOAMI_PB1200_DDR2)) {
>> + unsigned short t = bcsr_read(BCSR_HEXLEDS);
>> + bcsr_write(BCSR_HEXLEDS, ~t);
>> + if (bcsr_read(BCSR_HEXLEDS) != t) {
>> + bcsr_write(BCSR_HEXLEDS, t);
>> + return 0;
>> + }
>
> Isn't it worth putting the repetitive code into a subroutine?
If another Au1200-based reference board with similar hw design crops
up, maybe. The lines saved now however seemed not worth the effort.
Manuel
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] MIPS: BCM63XX: generate WLAN MAC address after registering ethernet devices., Sergei Shtylyov |
|---|---|
| Next by Date: | Re: [PATCH V3 2/5] MIPS: Add board support for Loongson1B, Ralf Baechle |
| Previous by Thread: | Re: [PATCH 1/3] MIPS: Alchemy: db1200: improve PB1200 detection., Sergei Shtylyov |
| Next by Thread: | [PATCH 1/3 v2] MIPS: BCM63xx: fix SDRAM size computation for BCM6345, Florian Fainelli |
| Indexes: | [Date] [Thread] [Top] [All Lists] |