
19 May
2005
19 May
'05
4:18 p.m.
Hi,
please consider this:
* Patch by Steven Scholz, 19 May 2005: Add support for CONFIG_SERIAL_TAG on ARM baords
If someone wants to pass the board's serial number to the ARM linux kernel using the ATAG_SERIAL mechanism, all she has to do is
#define CONFIG_REVISION_TAG
in the board config file and implement a trivial, board specific
#ifdef CONFIG_SERIAL_TAG void get_board_serial(struct tag_serialnr *serialnr) { serialnr->low = (u32) sernum; serialnr->high= (u32) 0; } #endif
Same goes for CONFIG_REVISION_TAG.
Thanks a million!
--
Steven Scholz
imc Measurement & Control
Index: u-boot/lib_arm/armlinux.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/lib_arm/armlinux.c,v
retrieving revision 1.16
diff -u -r1.16 armlinux.c
--- u-boot/lib_arm/armlinux.c 12 Jan 2005 00:15:17 -0000 1.16
+++ u-boot/lib_arm/armlinux.c 19 May 2005 14:12:07 -0000
@@ -377,15 +377,30 @@
}
#endif /* CONFIG_VFD || CONFIG_LCD */
+#ifdef CONFIG_SERIAL_TAG
+void setup_serial_tag (struct tag **tmp)
+{
+ struct tag *params = *tmp;
+ struct tag_serialnr serialnr;
+ void get_board_serial(struct tag_serialnr *serialnr);
+
+ get_board_serial(&serialnr);
+ params->hdr.tag = ATAG_SERIAL;
+ params->hdr.size = tag_size (tag_serialnr);
+ params->u.serialnr.low = serialnr.low;
+ params->u.serialnr.high= serialnr.high;
+ params = tag_next (params);
+ *tmp = params;
+}
+#endif
+
#ifdef CONFIG_REVISION_TAG
void setup_revision_tag(struct tag **in_params)
{
u32 rev = 0;
-#ifdef CONFIG_OMAP2420H4
u32 get_board_rev(void);
rev = get_board_rev();
-#endif
params->hdr.tag = ATAG_REVISION;
params->hdr.size = tag_size (tag_revision);
params->u.revision.rev = rev;