public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 1/2] fdt_support: Add a fdt_setup_simplefb_node helper function
Date: Tue, 18 Nov 2014 12:18:25 +0100	[thread overview]
Message-ID: <546B2B01.5090900@redhat.com> (raw)
In-Reply-To: <CAPnjgZ1eiHDTWuTo4UrxNMeYNS_fLdjTf6mgQ46womFEkB8v7w@mail.gmail.com>

Hi Simon,

On 11/17/2014 07:32 PM, Simon Glass wrote:
> Hi Hans,
> 
> On 17 November 2014 15:48, Hans de Goede <hdegoede@redhat.com> wrote:
>> Add a generic helper to fill and enable simplefb nodes.
>>
>> The first user of this will be the sunxi display code.
>>
>> lcd_dt_simplefb_configure_node is also a good candidate to be converted
>> to use this, but that requires someone to run some tests first, as
>> lcd_dt_simplefb_configure_node does not honor #address-cells and #size-cells,
>> but simply assumes 1 and 1 for both.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  common/fdt_support.c  | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  include/fdt_support.h |  3 +++
>>  2 files changed, 68 insertions(+)
>>
>> diff --git a/common/fdt_support.c b/common/fdt_support.c
>> index 3f64156..0ffa711 100644
>> --- a/common/fdt_support.c
>> +++ b/common/fdt_support.c
>> @@ -1523,3 +1523,68 @@ int fdt_read_range(void *fdt, int node, int n, uint64_t *child_addr,
>>
>>         return 0;
>>  }
>> +
>> +/**
>> + * fdt_setup_simplefb_node - Fill and enable a simplefb node
>> + *
>> + * @fdt: ptr to device tree
>> + * @node: offset of the simplefb node
>> + * @base_address: framebuffer base address
>> + * @width: width in pixels
>> + * @height: height in pixels
>> + * @stride: bytes per line
>> + * @format: pixel format string
>> + *
>> + * Convenience function to fill and enable a simplefb node.
>> + */
>> +int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
>> +                           u32 height, u32 stride, const char *format)
> 
> Please see lcd_dt_simplefb_configure_node() which seems similar.

As mentioned in the commit message already :) lcd_dt_simplefb_configure_node()
should be made to use this new helper function eventually.

There are several reasons why lcd_dt_simplefb_configure_node() is not usable
as a generic helper, and this new function is necessary:

1) It is lcd specific, only available if CONFIG_LCD is set
2) It does not take width / height / stride parameters, instead it reads global
variables from lcd.c which are only set if the other common/lcd.c functions are
used.
3) It hardcodes the format
4) It does not properly handle #address-cells and #size-cells

4) Is the main reason why I've not included a patch in my patch-set to move
lcd_dt_simplefb_configure_node() over to use this new helper, as I'm afraid
that may break things. of_bus_default_count_cells() will return different
values then the 1/1 the current lcd code assumes when no #address-cells or
#size-cells are present in the parent.

So my plan is to add this new helper, use it for sunxi, and ask someone who
has a board which is using lcd.c + simplefb to test moving lcd.c over to
the new helper.

Regards,

Hans

  reply	other threads:[~2014-11-18 11:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 15:48 [U-Boot] [PATCH v4 0/2] sunxi: video: Add simplefb support Hans de Goede
2014-11-17 15:48 ` [U-Boot] [PATCH v4 1/2] fdt_support: Add a fdt_setup_simplefb_node helper function Hans de Goede
2014-11-17 18:32   ` Simon Glass
2014-11-18 11:18     ` Hans de Goede [this message]
2014-11-18 14:30       ` Simon Glass
2014-11-17 15:48 ` [U-Boot] [PATCH v4 2/2] sunxi: video: Add simplefb support Hans de Goede
2014-11-17 18:39   ` Simon Glass
2014-11-18 11:23     ` Hans de Goede
2014-11-18 14:32       ` Simon Glass
2014-11-18 14:54         ` Hans de Goede
2014-11-18 15:08           ` Simon Glass
2014-11-17 19:12   ` Ian Campbell

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=546B2B01.5090900@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /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