All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Barth <aba@not.so.argh.org>
To: keguang.zhang@gmail.com
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	ralf@linux-mips.org, wuzhangjin@gmail.com, r0bertz@gentoo.org,
	chenj@lemote.com
Subject: Re: [PATCH] MIPS: Add basic support for Loongson1B
Date: Wed, 14 Sep 2011 13:31:34 +0200	[thread overview]
Message-ID: <20110914113134.GS15003@mails.so.argh.org> (raw)
In-Reply-To: <1315997270-14332-1-git-send-email-keguang.zhang@gmail.com>

* keguang.zhang@gmail.com (keguang.zhang@gmail.com) [110914 12:49]:
> This patch adds basic support for Loongson1B
> including serial, timer and interrupt handler.

I have a couple of questions. One of them is if it shouldn't be
possible to add this as part of the loongson-platform, and if we
really need a new platform. Each platform comes with some maintainence
costs which we should try to avoid. Making things more generic is
usually the right answer.


> diff --git a/arch/mips/include/asm/mach-loongson1/irq.h b/arch/mips/include/asm/mach-loongson1/irq.h
> new file mode 100644
> index 0000000..44cec4a
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-loongson1/irq.h
> @@ -0,0 +1,70 @@
> +/*
> + * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
> + *
> + * Register mappings for Loongson1.

Can't we do the mapping via device trees, or are we not there yet?


> --- /dev/null
> +++ b/arch/mips/loongson1/common/clock.c
> @@ -0,0 +1,164 @@
> +/*
> + * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>

Is this file not derived from any of the clock drivers we already have
in Linux?

Doesn't any of the existing clock drivers work? 

Is this clock part of the CPU? Otherwise it would make sense to move
it out to the generic drivers section.

> --- /dev/null
> +++ b/arch/mips/loongson1/common/irq.c
> @@ -0,0 +1,132 @@
> +/*
> + * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
> + *
> + * Based on Copyright (C) 2009 Lemote Inc.

same question here. Also, do you have permission from Lemote to put
the code within GPLv2?


> diff --git a/arch/mips/loongson1/common/prom.c b/arch/mips/loongson1/common/prom.c
> new file mode 100644
> index 0000000..84a25f6
> --- /dev/null
> +++ b/arch/mips/loongson1/common/prom.c

Can't we re-use the prom-routines from the loongson platform here? Or
even better, factor them out somewhere else in the mips or even
generic linux tree?

> index 0000000..b34ad35
> --- /dev/null
> +++ b/arch/mips/loongson1/common/reset.c


> +static void loongson1_halt(void)
> +{
> +	pr_notice("\n\n** You can safely turn off the power now **\n\n");
> +	while (1) {
> +		if (cpu_wait)
> +			cpu_wait();
> +	}
> +}


This code looks familiar to me, i.e. it shouldn't be
platform-specific.




Andi

  reply	other threads:[~2011-09-14 11:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14 10:47 [PATCH] MIPS: Add basic support for Loongson1B keguang.zhang
2011-09-14 11:31 ` Andreas Barth [this message]
2011-09-14 13:54   ` Kelvin Cheung
2011-09-14 16:00     ` Andreas Barth
2011-09-15  3:27       ` Kelvin Cheung
2011-09-15  7:07         ` Andreas Barth
2011-09-14 11:51 ` Lars-Peter Clausen
2011-09-14 14:12   ` Kelvin Cheung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110914113134.GS15003@mails.so.argh.org \
    --to=aba@not.so.argh.org \
    --cc=chenj@lemote.com \
    --cc=keguang.zhang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=r0bertz@gentoo.org \
    --cc=ralf@linux-mips.org \
    --cc=wuzhangjin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.