mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 8/9] archos: add atag appender for all features
@ 2013-03-11 22:24 Vicente Bergas
  2013-03-15  7:25 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Vicente Bergas @ 2013-03-11 22:24 UTC (permalink / raw)
  To: barebox, s.hauer; +Cc: Vicente Bergas

> I don't see a point in obfuscating this so much. Please call only call
> the features you want to have setup in the first place. For your own
> debugging purposes it makes no difference whether you edit the C file
> above or this header file. For different tablets with different features
> you need to find another solution anyway.
> 
> Sascha

I agree with you. My first intention was to put a place-holder for each feature
so it would be easy to customize for each tablet. But anyways the file has to
be edited for customization.
This second version of the patch leaves the same features, which are required,
but still has the changes for zeroing each feature before setting it.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/boards/archosg9/archos_features.c | 58 +++++++++---------------------
 1 file changed, 16 insertions(+), 42 deletions(-)

diff --git a/arch/arm/boards/archosg9/archos_features.c b/arch/arm/boards/archosg9/archos_features.c
index 5d93403..b396734 100644
--- a/arch/arm/boards/archosg9/archos_features.c
+++ b/arch/arm/boards/archosg9/archos_features.c
@@ -27,9 +27,9 @@ static void setup_feature_core(void)
 	features->hdr.tag = FTAG_CORE;
 	features->hdr.size = feature_tag_size(feature_tag_core);
 
+	memset(&features->u.core, 0, sizeof(features->u.core));
 	features->u.core.magic = FEATURE_LIST_MAGIC;
 	features->u.core.list_revision = FEATURE_LIST_REV;
-	features->u.core.flags = 0;
 
 	features = feature_tag_next(features);
 }
@@ -38,8 +38,7 @@ static void setup_feature_product_name(void)
 	features->hdr.tag = FTAG_PRODUCT_NAME;
 	features->hdr.size = feature_tag_size(feature_tag_product_name);
 
-	memset(features->u.product_name.name, 0,
-		sizeof(features->u.product_name.name));
+	memset(&features->u.product_name, 0, sizeof(features->u.product_name));
 	sprintf(features->u.product_name.name, "A80S");
 	features->u.product_name.id = 0x13A8;
 
@@ -50,10 +49,8 @@ static void setup_feature_product_serial_number(void)
 	features->hdr.tag = FTAG_PRODUCT_SERIAL_NUMBER;
 	features->hdr.size = feature_tag_size(feature_tag_product_serial);
 
-	features->u.product_serial.serial[0] = 0;
-	features->u.product_serial.serial[1] = 0;
-	features->u.product_serial.serial[2] = 0;
-	features->u.product_serial.serial[3] = 0;
+	memset(&features->u.product_serial, 0,
+		sizeof(features->u.product_serial));
 
 	features = feature_tag_next(features);
 }
@@ -62,14 +59,7 @@ static void setup_feature_product_mac_address(void)
 	features->hdr.tag = FTAG_PRODUCT_MAC_ADDRESS;
 	features->hdr.size = feature_tag_size(feature_tag_product_mac_address);
 
-	features->u.mac_address.addr[0] = 0;
-	features->u.mac_address.addr[1] = 0;
-	features->u.mac_address.addr[2] = 0;
-	features->u.mac_address.addr[3] = 0;
-	features->u.mac_address.addr[4] = 0;
-	features->u.mac_address.addr[5] = 0;
-	features->u.mac_address.reserved1 = 0;
-	features->u.mac_address.reserved2 = 0;
+	memset(&features->u.mac_address, 0, sizeof(features->u.mac_address));
 
 	features = feature_tag_next(features);
 }
@@ -78,6 +68,8 @@ static void setup_feature_board_pcb_revision(void)
 	features->hdr.tag = FTAG_BOARD_PCB_REVISION;
 	features->hdr.size = feature_tag_size(feature_tag_board_revision);
 
+	memset(&features->u.board_revision, 0,
+		sizeof(features->u.board_revision));
 	features->u.board_revision.revision = 5;
 
 	features = feature_tag_next(features);
@@ -87,23 +79,10 @@ static void setup_feature_sdram(void)
 	features->hdr.tag = FTAG_SDRAM;
 	features->hdr.size = feature_tag_size(feature_tag_sdram);
 
-	memset(features->u.sdram.vendor, 0, sizeof(features->u.sdram.vendor));
-	memset(features->u.sdram.product, 0,
-		sizeof(features->u.sdram.product));
+	memset(&features->u.sdram, 0, sizeof(features->u.sdram));
 	sprintf(features->u.sdram.vendor , "elpida");
-	sprintf(features->u.sdram.product, "EDB8064B1PB"/*"EDB4064B2PB"*/);
-	features->u.sdram.type     = 0;
-	features->u.sdram.revision = 0;
-	features->u.sdram.flags    = 0;
-	features->u.sdram.clock    = 400;
-	features->u.sdram.param_0  = 0;
-	features->u.sdram.param_1  = 0;
-	features->u.sdram.param_2  = 0;
-	features->u.sdram.param_3  = 0;
-	features->u.sdram.param_4  = 0;
-	features->u.sdram.param_5  = 0;
-	features->u.sdram.param_6  = 0;
-	features->u.sdram.param_7  = 0;
+	sprintf(features->u.sdram.product, "EDB8064B1PB");
+	features->u.sdram.clock = 400;
 
 	features = feature_tag_next(features);
 }
@@ -112,6 +91,7 @@ static void setup_feature_pmic(void)
 	features->hdr.tag = FTAG_PMIC;
 	features->hdr.size = feature_tag_size(feature_tag_pmic);
 
+	memset(&features->u.pmic, 0, sizeof(features->u.pmic));
 	features->u.pmic.flags = FTAG_PMIC_TPS62361;
 
 	features = feature_tag_next(features);
@@ -121,6 +101,7 @@ static void setup_feature_serial_port(void)
 	features->hdr.tag = FTAG_SERIAL_PORT;
 	features->hdr.size = feature_tag_size(feature_tag_serial_port);
 
+	memset(&features->u.serial_port, 0, sizeof(features->u.serial_port));
 	features->u.serial_port.uart_id = 1;
 	features->u.serial_port.speed = 115200;
 
@@ -131,9 +112,10 @@ static void setup_feature_has_gpio_volume_keys(void)
 	features->hdr.tag = FTAG_HAS_GPIO_VOLUME_KEYS;
 	features->hdr.size = feature_tag_size(feature_tag_gpio_volume_keys);
 
+	memset(&features->u.gpio_volume_keys, 0,
+		sizeof(features->u.gpio_volume_keys));
 	features->u.gpio_volume_keys.gpio_vol_up   = 0x2B;
 	features->u.gpio_volume_keys.gpio_vol_down = 0x2C;
-	features->u.gpio_volume_keys.flags = 0;
 
 	features = feature_tag_next(features);
 }
@@ -142,18 +124,9 @@ static void setup_feature_screen(void)
 	features->hdr.tag = FTAG_SCREEN;
 	features->hdr.size = feature_tag_size(feature_tag_screen);
 
-	memset(features->u.screen.vendor, 0,
-		sizeof(features->u.screen.vendor));
+	memset(&features->u.screen, 0, sizeof(features->u.screen));
 	sprintf(features->u.screen.vendor, "CMI");
-	features->u.screen.type = 0;
-	features->u.screen.revision = 0;
-	features->u.screen.vcom = 0;
 	features->u.screen.backlight = 0xC8;
-	features->u.screen.reserved[0] = 0;
-	features->u.screen.reserved[1] = 0;
-	features->u.screen.reserved[2] = 0;
-	features->u.screen.reserved[3] = 0;
-	features->u.screen.reserved[4] = 0;
 
 	features = feature_tag_next(features);
 }
@@ -162,6 +135,7 @@ static void setup_feature_turbo(void)
 	features->hdr.tag = FTAG_TURBO;
 	features->hdr.size = feature_tag_size(feature_tag_turbo);
 
+	memset(&features->u.turbo, 0, sizeof(features->u.turbo));
 	features->u.turbo.flag = 1;
 
 	features = feature_tag_next(features);
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH 0/9] Add support for booting ArchosG9 from sd-card
@ 2013-03-09 23:19 Vicente Bergas
  2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
  0 siblings, 1 reply; 4+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas

 This patch series ends up adding sd-card booting support to archosg9 boards.
 First 8 patches are improvements and minor fixes found during the process.

Vicente Bergas (9):
  defaultenv-2: don't load nonexistent file
  omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data
  omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx
  omap_uart: add low level port serial initialization
  panda: remove unused configuration items
  omap4_romusb: allow adding usb-serial when not booting from usb
  menu: avoid errors when building submenus
  archos: add atag appender for all features
  archosg9: enable booting from sd-card

 arch/arm/boards/archosg9/archos_features.c         | 414 +++++++++++++++++++--
 arch/arm/boards/archosg9/archos_features.h         |  39 ++
 arch/arm/boards/archosg9/board.c                   |   1 -
 arch/arm/boards/archosg9/env/boot/sd-card-android  |  11 +
 arch/arm/boards/archosg9/env/boot/sd-card-linux    |  17 +
 arch/arm/boards/archosg9/env/boot/usb-android      |  11 +
 arch/arm/boards/archosg9/env/boot/usb-linux        |  17 +
 arch/arm/boards/archosg9/env/config                |   3 -
 arch/arm/boards/archosg9/env/init/automount        |  28 ++
 arch/arm/boards/archosg9/env/init/bootsource       |  11 +
 arch/arm/boards/archosg9/env/init/usbboot          |   6 -
 arch/arm/boards/at91sam9m10ihd/env/boot/android    |   2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/mmc        |   2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/net        |   2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/net-usb    |   2 +-
 arch/arm/boards/beagle/env/boot/mmc                |   2 +-
 arch/arm/boards/beagle/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/beagle/env/boot/nand-ubi-dt        |   2 +-
 arch/arm/boards/beaglebone/env/boot/sd             |   2 +-
 arch/arm/boards/clep7212/env/boot/nor              |   2 +-
 .../boards/crystalfontz-cfa10036/env/boot/mmc-ext3 |   2 +-
 .../boards/efika-mx-smartbook/env/boot/hd-internal |   2 +-
 .../boards/efika-mx-smartbook/env/boot/mmc-left    |   2 +-
 arch/arm/boards/guf-vincell/env/boot/nand-ubi      |   2 +-
 arch/arm/boards/karo-tx25/env/boot/nand-ubi        |   2 +-
 arch/arm/boards/omap3evm/board.c                   |   4 +-
 arch/arm/boards/omap3evm/lowlevel.c                |   4 +-
 arch/arm/boards/panda/env/boot/mmc                 |   2 +-
 arch/arm/boards/pcm037/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/pcm038/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/pcm043/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/pcm051/env/boot/sd                 |   2 +-
 arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi   |   2 +-
 arch/arm/configs/archosg9_defconfig                |  67 ++--
 arch/arm/configs/archosg9_xload_defconfig          |  20 +-
 arch/arm/configs/panda_xload_defconfig             |   3 -
 arch/arm/mach-omap/Kconfig                         |  11 +-
 arch/arm/mach-omap/include/mach/debug_ll.h         |  27 +-
 arch/arm/mach-omap/include/mach/omap4_rom_usb.h    |   3 +
 arch/arm/mach-omap/omap4_rom_usb.c                 |  95 +++--
 defaultenv-2/base/bin/init                         |   2 +-
 defaultenv-2/base/boot/net                         |   2 +-
 defaultenv-2/base/data/boot-template               |   2 +-
 defaultenv-2/menu/menu/boot-entries-collect        |   4 +-
 defaultenv-2/menu/menu/boot-entries-edit           |   2 +-
 defaultenv-2/menu/menu/boot-entries-remove         |   2 +-
 defaultenv-2/menu/menu/boot-menu-add-entry         |   6 +-
 defaultenv-2/menu/menu/mainmenu                    |   2 +-
 drivers/serial/serial_omap4_usbboot.c              |   2 +
 49 files changed, 686 insertions(+), 170 deletions(-)
 create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-android
 create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-linux
 create mode 100644 arch/arm/boards/archosg9/env/boot/usb-android
 create mode 100644 arch/arm/boards/archosg9/env/boot/usb-linux
 delete mode 100644 arch/arm/boards/archosg9/env/config
 create mode 100644 arch/arm/boards/archosg9/env/init/automount
 create mode 100644 arch/arm/boards/archosg9/env/init/bootsource
 delete mode 100644 arch/arm/boards/archosg9/env/init/usbboot

-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-15  7:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11 22:24 [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
2013-03-15  7:25 ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
2013-03-11  8:36   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox