* [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array [not found] ` <1326780682-10260-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> @ 2012-01-17 6:11 ` Simon Glass 2012-01-17 6:30 ` Mike Frysinger 2012-01-17 6:11 ` [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition Simon Glass 2012-01-17 6:11 ` [PATCH v3 6/9] tegra: fdt: Add keyboard definitions for Seaboard Simon Glass 2 siblings, 1 reply; 7+ messages in thread From: Simon Glass @ 2012-01-17 6:11 UTC (permalink / raw) To: U-Boot Mailing List; +Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Sometimes we don't need a full cell for each value. This provides a simple function to read a byte array, both with and without copying it. Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> --- Changes in v2: - Use correct name for get_prop_check_min_len() function include/fdtdec.h | 32 ++++++++++++++++++++++++++++++++ lib/fdtdec.c | 24 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 0 deletions(-) diff --git a/include/fdtdec.h b/include/fdtdec.h index 64e2f88..9fd4e38 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -325,3 +325,35 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio); * @return */ int fdtdec_decode_periph_id(const void *blob, int node); + +/* + * Look up a property in a node and return its contents in a byte + * array of given length. The property must have at least enough data for + * the array (count bytes). It may have more, but this will be ignored. + * + * @param blob FDT blob + * @param node node to examine + * @param prop_name name of property to find + * @param array array to fill with data + * @param count number of array elements + * @return 0 if ok, or -FDT_ERR_MISSING if the property is not found, + * or -FDT_ERR_BADLAYOUT if not enough data + */ +int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name, + u8 *array, int count); + +/** + * Look up a property in a node and return a pointer to its contents as a + * byte array of given length. The property must have at least enough data + * for the array (count bytes). It may have more, but this will be ignored. + * The data is not copied. + * + * @param blob FDT blob + * @param node node to examine + * @param prop_name name of property to find + * @param count number of array elements + * @return pointer to byte array if found, or NULL if the property is not + * found or there is not enough data + */ +const u8 *fdtdec_locate_byte_array(const void *blob, int node, + const char *prop_name, int count); diff --git a/lib/fdtdec.c b/lib/fdtdec.c index db377c7..140310d 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -462,3 +462,27 @@ int fdtdec_decode_periph_id(const void *blob, int node) return cell[1]; } + +int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name, + u8 *array, int count) +{ + const u8 *cell; + int err; + + cell = get_prop_check_min_len(blob, node, prop_name, count, &err); + if (!err) + memcpy(array, cell, count); + return err; +} + +const u8 *fdtdec_locate_byte_array(const void *blob, int node, + const char *prop_name, int count) +{ + const u8 *cell; + int err; + + cell = get_prop_check_min_len(blob, node, prop_name, count, &err); + if (err) + return NULL; + return cell; +} -- 1.7.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array 2012-01-17 6:11 ` [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array Simon Glass @ 2012-01-17 6:30 ` Mike Frysinger [not found] ` <201201170130.48257.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Mike Frysinger @ 2012-01-17 6:30 UTC (permalink / raw) To: devicetree-discuss; +Cc: U-Boot Mailing List, Jerry Van Baren, Tom Warren [-- Attachment #1.1: Type: Text/Plain, Size: 444 bytes --] On Tuesday 17 January 2012 01:11:14 Simon Glass wrote: > From: Anton Staff <robotboy@chromium.org> > > Sometimes we don't need a full cell for each value. This provides > a simple function to read a byte array, both with and without > copying it. > > Signed-off-by: Simon Glass <sjg@chromium.org> seems like getting s-o-b from Anton should be fairly easy ;) (there's a few other patches in this series with that problem) -mike [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 134 bytes --] _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <201201170130.48257.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array [not found] ` <201201170130.48257.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> @ 2012-01-17 7:11 ` Simon Glass 2012-01-17 15:52 ` Mike Frysinger 0 siblings, 1 reply; 7+ messages in thread From: Simon Glass @ 2012-01-17 7:11 UTC (permalink / raw) To: Mike Frysinger Cc: U-Boot Mailing List, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jerry Van Baren, Tom Warren Hi Mike, On Mon, Jan 16, 2012 at 10:30 PM, Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> wrote: > On Tuesday 17 January 2012 01:11:14 Simon Glass wrote: >> From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> >> >> Sometimes we don't need a full cell for each value. This provides >> a simple function to read a byte array, both with and without >> copying it. >> >> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > > seems like getting s-o-b from Anton should be fairly easy ;) > I have the jellybeans ready. I will make a list of those I need - it is a pretty long list now. Does patchwork pick it up automatically if they reply to the list? Regards, Simon > (there's a few other patches in this series with that problem) > -mike ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array 2012-01-17 7:11 ` Simon Glass @ 2012-01-17 15:52 ` Mike Frysinger 0 siblings, 0 replies; 7+ messages in thread From: Mike Frysinger @ 2012-01-17 15:52 UTC (permalink / raw) To: Simon Glass Cc: U-Boot Mailing List, devicetree-discuss, Jerry Van Baren, Tom Warren [-- Attachment #1.1: Type: Text/Plain, Size: 851 bytes --] On Tuesday 17 January 2012 02:11:58 Simon Glass wrote: > On Mon, Jan 16, 2012 at 10:30 PM, Mike Frysinger wrote: > > On Tuesday 17 January 2012 01:11:14 Simon Glass wrote: > >> From: Anton Staff <robotboy@chromium.org> > >> > >> Sometimes we don't need a full cell for each value. This provides > >> a simple function to read a byte array, both with and without > >> copying it. > >> > >> Signed-off-by: Simon Glass <sjg@chromium.org> > > > > seems like getting s-o-b from Anton should be fairly easy ;) > > I have the jellybeans ready. I will make a list of those I need - it > is a pretty long list now. Does patchwork pick it up automatically if > they reply to the list? i believe it does if they reply to the patch in question. at least, it should be easy to check (have him reply and then d/l it via patchwork). -mike [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 134 bytes --] _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition [not found] ` <1326780682-10260-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2012-01-17 6:11 ` [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array Simon Glass @ 2012-01-17 6:11 ` Simon Glass [not found] ` <1326780682-10260-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2012-01-17 6:11 ` [PATCH v3 6/9] tegra: fdt: Add keyboard definitions for Seaboard Simon Glass 2 siblings, 1 reply; 7+ messages in thread From: Simon Glass @ 2012-01-17 6:11 UTC (permalink / raw) To: U-Boot Mailing List; +Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> The Tegra keyboard controller provides a simple interface to a matrix keyboard. Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> --- arch/arm/dts/tegra20.dtsi | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi index 33d6972..3d435aa 100644 --- a/arch/arm/dts/tegra20.dtsi +++ b/arch/arm/dts/tegra20.dtsi @@ -216,4 +216,9 @@ compatible = "nvidia,tegra20-nand"; reg = <0x70008000 0x100>; }; + + kbc@7000e200 { + compatible = "nvidia,tegra20-kbc"; + reg = <0x7000e200 0x0078>; + }; }; -- 1.7.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <1326780682-10260-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>]
* Re: [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition [not found] ` <1326780682-10260-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> @ 2012-01-20 23:30 ` Stephen Warren 0 siblings, 0 replies; 7+ messages in thread From: Stephen Warren @ 2012-01-20 23:30 UTC (permalink / raw) To: Simon Glass Cc: U-Boot Mailing List, Devicetree Discuss, Tom Warren, Jerry Van Baren On 01/16/2012 11:11 PM, Simon Glass wrote: > From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > > The Tegra keyboard controller provides a simple interface to a matrix > keyboard. > diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi > + kbc@7000e200 { > + compatible = "nvidia,tegra20-kbc"; > + reg = <0x7000e200 0x0078>; > + }; The KBC has interrupts to, which should be added to the .dtsi even if you don't use them. I think you want: interrupts = <0 85 0x04>; -- nvpublic ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 6/9] tegra: fdt: Add keyboard definitions for Seaboard [not found] ` <1326780682-10260-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2012-01-17 6:11 ` [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array Simon Glass 2012-01-17 6:11 ` [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition Simon Glass @ 2012-01-17 6:11 ` Simon Glass 2 siblings, 0 replies; 7+ messages in thread From: Simon Glass @ 2012-01-17 6:11 UTC (permalink / raw) To: U-Boot Mailing List; +Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Seaboard uses a QUERTY keyboard. We add key codes for this to enable key scanning to work. Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> --- Changes in v2: - Remove status = "okay" since this is the default anyway Changes in v3: - Move to new Linux device tree mapping for Tegra keyboard board/nvidia/dts/tegra2-seaboard.dts | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts index cc9abe2..a720992 100644 --- a/board/nvidia/dts/tegra2-seaboard.dts +++ b/board/nvidia/dts/tegra2-seaboard.dts @@ -140,4 +140,31 @@ page-spare-bytes = <64>; }; }; + + kbc@7000e200 { + linux,keymap = <0x00020011 0x0003001f 0x0004001e 0x0005002c + 0x000701d0 0x0107007d 0x02060064 0x02070038 0x03000006 + 0x03010005 0x03020013 0x03030012 0x03040021 0x03050020 + 0x0306002d 0x04000008 0x04010007 0x04020014 0x04030023 + 0x04040022 0x0405002f 0x0406002e 0x04070039 0x0500000a + 0x05010009 0x05020016 0x05030015 0x05040024 0x05050031 + 0x05060030 0x0507002b 0x0600000c 0x0601000b 0x06020018 + 0x06030017 0x06040026 0x06050025 0x06060033 0x06070032 + 0x0701000d 0x0702001b 0x0703001c 0x0707008b 0x08040036 + 0x0805002a 0x09050061 0x0907001d 0x0b00001a 0x0b010019 + 0x0b020028 0x0b030027 0x0b040035 0x0b050034 0x0c000044 + 0x0c010043 0x0c02000e 0x0c030004 0x0c040003 0x0c050067 + 0x0c0600d2 0x0c070077 0x0d00006e 0x0d01006f 0x0d030068 + 0x0d04006d 0x0d05006a 0x0d06006c 0x0d070069 0x0e000057 + 0x0e010058 0x0e020042 0x0e030010 0x0e04003e 0x0e05003d + 0x0e060002 0x0e070041 0x0f000001 0x0f010029 0x0f02003f + 0x0f03000f 0x0f04003b 0x0f05003c 0x0f06003a 0x0f070040 + 0x14000047 0x15000049 0x15010048 0x1502004b 0x1504004f + 0x16010062 0x1602004d 0x1603004c 0x16040051 0x16050050 + 0x16070052 0x1b010037 0x1b03004a 0x1b04004e 0x1b050053 + 0x1c050073 0x1d030066 0x1d04006b 0x1d0500e0 0x1d060072 + 0x1d0700e1 0x1e000045 0x1e010046 0x1e020071 + 0x1f04008a>; + linux,fn-keymap = <0x05040002>; + }; }; -- 1.7.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-20 23:30 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1326780682-10260-1-git-send-email-sjg@chromium.org> [not found] ` <1326780682-10260-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2012-01-17 6:11 ` [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array Simon Glass 2012-01-17 6:30 ` Mike Frysinger [not found] ` <201201170130.48257.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> 2012-01-17 7:11 ` Simon Glass 2012-01-17 15:52 ` Mike Frysinger 2012-01-17 6:11 ` [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition Simon Glass [not found] ` <1326780682-10260-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2012-01-20 23:30 ` Stephen Warren 2012-01-17 6:11 ` [PATCH v3 6/9] tegra: fdt: Add keyboard definitions for Seaboard Simon Glass
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).