From: Arnd Bergmann <arnd@arndb.de>
To: Mark Salter <msalter@redhat.com>
Cc: linux-arch@vger.kernel.org
Subject: Re: [PATCH 05/24] C6X: early boot code
Date: Tue, 9 Aug 2011 18:12:35 +0200 [thread overview]
Message-ID: <201108091812.35688.arnd@arndb.de> (raw)
In-Reply-To: <1312839879-13592-6-git-send-email-msalter@redhat.com>
On Monday 08 August 2011, Mark Salter wrote:
> +static const char *cpu_name, *cpu_voltage, *mmu, *fpu;
> +static char *soc_rev;
> +static char __cpu_rev[5], *cpu_rev;
> +static size_t initrd_size = CONFIG_BLK_DEV_RAM_SIZE*1024;
> +static unsigned int core_id;
Better make a data structure for the elements that you have per CPU,
that will help you when you get to SMP.
> +static void __init probe_machine(void)
> +{
> + /*
> + * Iterate all c6x_md structures until we find the proper
> + * one for the current machine type
> + */
> + for (machine_id = &__machine_desc_start;
> + machine_id < &__machine_desc_end;
> + machine_id++) {
> + memcpy(&c6x_md, machine_id, sizeof(struct machdep_calls));
> + if (c6x_md.probe())
> + break;
> + }
> + /* What can we do if we didn't find ? */
> + if (machine_id >= &__machine_desc_end) {
> + DBG("No suitable machine found !\n");
> + for (;;)
> + ;
> + }
> +
> + printk(KERN_INFO "Using %s machine description\n", c6x_md.name);
> +}
Why do you need separate machine descriptors? Since you can do all probing
through the device tree, you should not need to copy the complexity of
architectures that don't use it everywhere yet.
> +
> +static int show_cpuinfo(struct seq_file *m, void *v)
> +{
> + seq_printf(m,
> + "CPU:\t\t%s\n"
> + "Core revision:\t%s\n"
> + "Core voltage:\t%s\n"
> + "Core id:\t%d\n"
> + "SoC cores:\t%d\n"
> + "MMU:\t\t%s\n"
> + "FPU:\t\t%s\n"
> + "Silicon rev:\t%s\n"
> + "Clocking:\t%uMHz\n"
> + "BogoMips:\t%lu.%02lu\n"
> + "Calibration:\t%lu loops\n",
> + cpu_name, cpu_rev, cpu_voltage,
> + core_id, c6x_num_cores, mmu, fpu,
> + soc_rev, (c6x_core_freq + 500000) / 1000000,
> + (loops_per_jiffy/(500000/HZ)),
> + (loops_per_jiffy/(5000/HZ))%100,
> + loops_per_jiffy);
> +
> + return 0;
> +}
The fields are commonly all lowercase. Start with a line 'processor:\t0' to make it
easier to extend for multiple CPUs.
Out of "Clocking", "BogoMips" and "Calibration", you probably should have
only one, since they are all interdependent.
Arnd
next prev parent reply other threads:[~2011-08-09 16:12 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-08 21:44 [PATCH 00/24] C6X: New architecture patch set Mark Salter
2011-08-08 21:44 ` [PATCH 01/24] fix default __strnlen_user macro Mark Salter
2011-08-08 21:44 ` [PATCH 02/24] fixed generic page.h for non-zero PAGE_OFFSET Mark Salter
2011-08-09 15:11 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 03/24] add ELF machine define for TI C6X DSPs Mark Salter
2011-08-09 15:12 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 04/24] C6X: build infrastructure Mark Salter
2011-08-09 15:21 ` Arnd Bergmann
2011-08-09 15:56 ` Mark Salter
2011-08-09 19:17 ` Sam Ravnborg
2011-08-08 21:44 ` [PATCH 05/24] C6X: early boot code Mark Salter
2011-08-09 16:12 ` Arnd Bergmann [this message]
2011-08-09 19:26 ` Sam Ravnborg
2011-08-08 21:44 ` [PATCH 06/24] C6X: devicetree Mark Salter
2011-08-09 16:14 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 07/24] C6X: memory management Mark Salter
2011-08-09 16:27 ` Arnd Bergmann
2011-08-17 13:26 ` Mark Salter
2011-08-17 13:34 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 08/24] C6X: process management Mark Salter
2011-08-09 16:31 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 09/24] C6X: signal management Mark Salter
2011-08-08 21:44 ` [PATCH 10/24] C6X: time management Mark Salter
2011-08-09 16:35 ` Arnd Bergmann
2011-08-17 13:15 ` Mark Salter
2011-08-17 13:31 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 11/24] C6X: interrupt handling Mark Salter
2011-08-09 16:39 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 12/24] C6X: syscalls Mark Salter
2011-08-09 16:47 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 13/24] C6X: traps Mark Salter
2011-08-08 21:44 ` [PATCH 14/24] C6X: clocks Mark Salter
2011-08-08 21:44 ` [PATCH 15/24] C6X: cache control Mark Salter
2011-08-09 16:53 ` Arnd Bergmann
2011-08-09 17:03 ` David Howells
2011-08-10 9:38 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 16/24] C6X: module support Mark Salter
2011-08-09 16:56 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 17/24] C6X: ptrace support Mark Salter
2011-08-09 16:58 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 18/24] C6X: headers Mark Salter
2011-08-08 21:44 ` [PATCH 19/24] C6X: library code Mark Salter
2011-08-08 21:44 ` [PATCH 20/24] C6X: general machine and SoC support Mark Salter
2011-08-08 21:44 ` [PATCH 21/24] C6X: specific " Mark Salter
2011-08-08 21:44 ` [PATCH 22/24] C6X: specific board support Mark Salter
2011-08-09 17:04 ` Arnd Bergmann
2011-08-09 17:16 ` Mark Salter
2011-08-10 14:26 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 23/24] C6X: miscellaneous low-level SoC support Mark Salter
2011-08-09 17:10 ` Arnd Bergmann
2011-08-08 21:44 ` [PATCH 24/24] C6X: MAINTAINERS Mark Salter
-- strict thread matches above, loose matches on Subject: below --
2011-08-22 20:09 [PATCH v2 00/24] C6X: New architecture patch set Mark Salter
2011-08-22 20:09 ` [PATCH 05/24] C6X: early boot code Mark Salter
2011-08-31 21:26 [PATCH v2 00/24] C6X: New architecture patch set Mark Salter
2011-08-31 21:26 ` [PATCH 05/24] C6X: early boot code Mark Salter
2011-08-31 21:26 ` Mark Salter
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=201108091812.35688.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=msalter@redhat.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.