devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH TIP 02/14] x86: Add device tree support
Date: Thu, 17 Feb 2011 12:03:34 +0100	[thread overview]
Message-ID: <4D5D0086.801@linutronix.de> (raw)
In-Reply-To: <20110216212623.GA22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>

Grant Likely wrote:
> Hi Sebastian,
Hi Grant,

> 
> Relatively minor comments below.  You can go ahead and add the
> following when you respin:
> 
> Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>

Cool.

>> diff --git a/Documentation/x86/boot_with_dtb.txt b/Documentation/x86/boot_with_dtb.txt
>> new file mode 100644
>> index 0000000..6a357aa
>> --- /dev/null
>> +++ b/Documentation/x86/boot_with_dtb.txt
>> @@ -0,0 +1,26 @@
>> +  Booting x86 with device tree
>> +=================================
>> +
>> +1. Introduction
>> +~~~~~~~~~~~~~~~
>> +This document contains device tree information which are specific to
>> +the x86 platform. Generic informations as bindings can be found in
>> +Documentation/powerpc/dts-bindings/
>> +
>> +2. Passing the device tree
>> +~~~~~~~~~~~~~~~~~~~~~~~~~~
>> +The pointer to the device tree block (dtb) is passed via setup_data
>> +(see [0]) which requires at least boot protocol 2.09. The type filed is
>> +defined as
>> +
>> +#define SETUP_DTB                      2
>> +
>> +3. Purpose
>> +~~~~~~~~~~~
>> +The device tree is used as an extension to the "boot page". As such it does not
>> +parse / consider data which are already covered by the boot page. This includes
>> +memory size, command line arguments or initrd address.
>> +It simply holds information which can not be retrieved otherwise like interrupt
>> +routing or a list of devices behind an I2C bus.
>> +
>> +[0] Documentation/x86/boot.txt
> 
> Please also add a brief description to section I of
> Documentation/devicetree/booting-without-of.txt

I assumed this file is powerpc only. Since you added arm there I have no
problem to move this content there.

>> diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
>> index b4ec95f..b227ba7 100644
>> --- a/arch/x86/include/asm/prom.h
>> +++ b/arch/x86/include/asm/prom.h
>> @@ -1 +1,59 @@
>> -/* dummy prom.h; here to make linux/of.h's #includes happy */
>> +/*
>> + * Definitions for Device tree / OpenFirmware handling on X86
>> + *
>> + * based on arch/powerpc/include/asm/prom.h which is
>> + *         Copyright (C) 1996-2005 Paul Mackerras.
>> + *
>> + * 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_X86_PROM_H
>> +#define _ASM_X86_PROM_H
>> +#ifndef __ASSEMBLY__
>> +
>> +#include <linux/of.h>
>> +#include <linux/types.h>
>> +#include <asm/irq.h>
>> +#include <asm/atomic.h>
>> +#include <asm/setup.h>
>> +
>> +#ifdef CONFIG_OF
>> +extern void add_dtb(u64 data);
>> +#else
>> +static inline void add_dtb(u64 data) { }
>> +#endif
>> +
>> +extern char cmd_line[COMMAND_LINE_SIZE];
>> +/* This number is used when no interrupt has been assigned */
>> +#define NO_IRQ		(0)
> 
> This line should no longer be necessary.  drivers/of/irq.c defines
> NO_IRQ if it isn't already defined by the architecture.  I'm trying to
> limit the exposure of NO_IRQ in dt code.

okay, I will to remove that.

>> +#endif /* __ASSEMBLY__ */
>> +
>> +/*
>> + * These includes are put at the bottom because they may contain things
>> + * that are overridden by this file.  Ideally they shouldn't be included
>> + * by this file, but there are a bunch of .c files that currently depend
>> + * on it.  Eventually they will be cleaned up.
>> + */
>> +#include <linux/of_fdt.h>
>> +#include <linux/of_irq.h>
>> +#include <linux/platform_device.h>
> 
> You should be able to remove these includes.  The problems described
> in the header are mostly with device drivers and architecture code.
> You shouldn't run into any of those issue, and if you do they should
> be fixed at the source.
okay.

>> index c752e97..149c87f 100644
>> --- a/arch/x86/kernel/irqinit.c
>> +++ b/arch/x86/kernel/irqinit.c
>> @@ -25,6 +25,7 @@
>>  #include <asm/setup.h>
>>  #include <asm/i8259.h>
>>  #include <asm/traps.h>
>> +#include <asm/prom.h>
> 
> I'm probably missing something.  I don't see any changes to irqinit.c
> other than this.  What symbol definition has been moved to prom.h that
> irqinit.c needs?

This hunk was folded into the wrong patch. It should been folded into
"x86/ioapic: Add OF bindings for IO-APIC".

>>  /*
>>   * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
>> diff --git a/arch/x86/kernel/prom.c b/arch/x86/kernel/prom.c
>> new file mode 100644
>> index 0000000..4969ffa
>> --- /dev/null
>> +++ b/arch/x86/kernel/prom.c
> 
> You don't need to name this prom.c.  devicetree.c would make more sense.
> prom is a legacy name from when only Open Firmware systems were using
> the dt code.

okay.

>> @@ -0,0 +1,51 @@

>> +
>> +void __init add_dtb(u64 data)
>> +{
>> +	initial_boot_params = (struct boot_param_header *)
>> +		phys_to_virt((u64) (u32) data +
>> +				offsetof(struct setup_data, data));
> 
> (struct boot_param_header *) cast unnecessary since phys_to_virt
> should return a void*.

removed.

>> +}

Sebastian

  parent reply	other threads:[~2011-02-17 11:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24  4:28 Device tree on x86, part v3 Sebastian Andrzej Siewior
     [not found] ` <1295843342-1122-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-01-24  4:28   ` [PATCH TIP 01/14] x86/e820: remove conditional early mapping in parse_e820_ext Sebastian Andrzej Siewior
2011-02-03 20:57     ` Grant Likely
2011-01-24  4:28   ` [PATCH TIP 02/14] x86: Add device tree support Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-3-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-01-24  4:34       ` Sebastian Andrzej Siewior
     [not found]         ` <20110124043427.GA20274-Hfxr4Dq0UpYb1SvskN2V4Q@public.gmane.org>
2011-02-16 21:27           ` Grant Likely
     [not found]             ` <20110216212746.GB22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-17 11:05               ` [sodaville] " Sebastian Andrzej Siewior
2011-02-16 21:31       ` Grant Likely
     [not found]         ` <20110216213126.GC22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-17 11:31           ` [sodaville] " Sebastian Andrzej Siewior
2011-02-17 17:02             ` Grant Likely
2011-02-16 21:26     ` Grant Likely
     [not found]       ` <20110216212623.GA22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-17 11:03         ` Sebastian Andrzej Siewior [this message]
2011-01-24  4:28   ` [PATCH TIP 03/14] x86/dtb: Add a device tree for CE4100 Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-4-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-01-27  5:00       ` David Gibson
2011-01-27  9:11         ` Sebastian Andrzej Siewior
2011-02-03 20:59           ` Grant Likely
     [not found]             ` <20110203205928.GH6180-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-03 21:32               ` Mitch Bradley
     [not found]                 ` <4D4B1EFD.4060305-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2011-02-04  9:40                   ` Sebastian Andrzej Siewior
2011-02-02 18:58         ` [PATCH TIP v2 " Sebastian Andrzej Siewior
     [not found]           ` <20110202185841.GA28674-Hfxr4Dq0UpYb1SvskN2V4Q@public.gmane.org>
2011-02-03 21:07             ` Grant Likely
     [not found]               ` <20110203210746.GI6180-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-04 10:06                 ` Sebastian Andrzej Siewior
2011-02-16 21:44             ` Grant Likely
     [not found]               ` <20110216214428.GD22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-22 11:21                 ` [sodaville] " Sebastian Andrzej Siewior
2011-01-24  4:28   ` [PATCH TIP 04/14] x86/dtb: add irq domain abstraction Sebastian Andrzej Siewior
2011-01-24  4:28   ` [PATCH TIP 05/14] x86/dtb: add early parsing of APIC and IO APIC Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-6-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-02-16 21:47       ` Grant Likely
2011-01-24  4:28   ` [PATCH TIP 06/14] x86/dtb: add support hpet Sebastian Andrzej Siewior
2011-01-24  4:28   ` [PATCH OF 07/14] of: move of_irq_map_pci() into generic code Sebastian Andrzej Siewior
2011-02-10 13:57     ` Michal Simek
2011-02-16 21:53     ` Grant Likely
     [not found]       ` <AANLkTimE=mB_yWsOeD3zw+b4cHFx591h-605tK4yWAJr-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-17  7:49         ` Michal Simek
2011-01-24  4:28   ` [PATCH TIP 08/14] x86/dtb: add support for PCI devices backed by dtb nodes Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-9-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-02-16 21:59       ` Grant Likely
     [not found]         ` <AANLkTimWxmEcr=7AibGUht3bBi7ms2MRqj4Qj-jwEGBB-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-22 11:21           ` [sodaville] " Sebastian Andrzej Siewior
2011-01-24  4:28   ` [PATCH TIP 09/14] x86/dtb: Add generic bus probe Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-10-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-02-04 10:21       ` [PATCH v2 " Sebastian Andrzej Siewior
     [not found]         ` <20110204102152.GA7231-Hfxr4Dq0UpYb1SvskN2V4Q@public.gmane.org>
2011-02-16 22:04           ` Grant Likely
2011-01-24  4:28   ` [PATCH TIP 10/14] x86/ioapic: Add OF bindings for IO-APIC Sebastian Andrzej Siewior
2011-02-16 22:04     ` Grant Likely
2011-01-24  4:28   ` [PATCH TIP 11/14] x86/ce4100: use OF for ioapic Sebastian Andrzej Siewior
2011-01-24  4:29   ` [PATCH OF 12/14] x86/rtc: don't register rtc if we the DT blob Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-13-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-02-16 22:08       ` Grant Likely
2011-02-16 22:09       ` Grant Likely
     [not found]         ` <20110216220921.GI22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-17 13:13           ` [sodaville] " Sebastian Andrzej Siewior
2011-01-24  4:29   ` [PATCH OF 13/14] rtc/cmos: add OF bindings Sebastian Andrzej Siewior
     [not found]     ` <1295843342-1122-14-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-01-24  4:38       ` Sebastian Andrzej Siewior
2011-02-16 22:11       ` Grant Likely
     [not found]         ` <20110216221108.GJ22837-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-17 13:26           ` [sodaville] " Sebastian Andrzej Siewior
2011-02-17 16:46             ` Grant Likely
2011-01-24  4:29   ` [PATCH TIP 14/14] x86/pci: remove warning Sebastian Andrzej Siewior

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=4D5D0086.801@linutronix.de \
    --to=bigeasy-hfztesqfncyowbw4kg4ksq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).