summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2e1cb4)
raw | patch | inline | side by side (parent: f2e1cb4)
author | Nishanth Menon <nm@ti.com> | |
Tue, 10 Nov 2015 00:34:43 +0000 (18:34 -0600) | ||
committer | Tero Kristo <t-kristo@ti.com> | |
Tue, 10 Nov 2015 07:54:46 +0000 (09:54 +0200) |
Kernel stores information to the RTC_SCRATCH0 and RTC_SCRATCH1
registers for wakeup from RTC-only mode. Parse these registers during
SPL boot and jump to the kernel resume vector if the device is waking
up from RTC-only mode
During the normal boot patch the SCRATCH1 : bits16-31 are updated
with the eeprom read board type data. In the rtc_only boot path the
rtc scratchpad register is read and the board type is determined and
correspondingly ddr dpll parameters are set. This is done so as to
avoid costly i2c read to eeprom.
So, we update the eeprom data store region with data corresponding to
this.
Signed-off-by: Nishanth Menon <nm@ti.com>
registers for wakeup from RTC-only mode. Parse these registers during
SPL boot and jump to the kernel resume vector if the device is waking
up from RTC-only mode
During the normal boot patch the SCRATCH1 : bits16-31 are updated
with the eeprom read board type data. In the rtc_only boot path the
rtc scratchpad register is read and the board type is determined and
correspondingly ddr dpll parameters are set. This is done so as to
avoid costly i2c read to eeprom.
So, we update the eeprom data store region with data corresponding to
this.
Signed-off-by: Nishanth Menon <nm@ti.com>
board/ti/common/board_detect.c | patch | blob | history | |
board/ti/common/include/board_detect.h | patch | blob | history |
index 660f069c854b6a0226f3235d1447bd12a9336dbb..01a126facc9cb937d9124936fc16e3890b4b0051 100644 (file)
return 0;
}
+int __maybe_unused ti_i2c_eeprom_am_set(const char *name, const char *rev)
+{
+ struct ti_am_eeprom *ep;
+
+ if (!name || !rev)
+ return -1;
+
+ ep = TI_AM_EEPROM_DATA;
+ if (ep->header == TI_EEPROM_HEADER_MAGIC)
+ goto already_set;
+
+ /* Set to 0 all fields */
+ memset(ep, 0, sizeof(*ep));
+ strncpy(ep->name, name, TI_EEPROM_HDR_NAME_LEN);
+ strncpy(ep->version, rev, TI_EEPROM_HDR_REV_LEN);
+ /* Some dummy serial number to identify the platform */
+ strncpy(ep->serial, "0000", TI_EEPROM_HDR_SERIAL_LEN);
+ /* Mark it with a valid header */
+ ep->header = TI_EEPROM_HEADER_MAGIC;
+
+already_set:
+ return 0;
+}
+
bool __maybe_unused board_am_is(char *name_tag)
{
struct ti_am_eeprom *ep = TI_AM_EEPROM_DATA;
index a537c2c303b096ff76434e40ff02022b885851ce..4b3365eeb88ea2b9152d1c08d9c213ca1e8e3c6a 100644 (file)
void set_board_info_env(char *name, char *revision,
char *serial);
+/**
+ * ti_i2c_eeprom_am_set() - Setup the eeprom data with predefined values
+ * @name: Name of the board
+ * @rev: Revision of the board
+ *
+ * In some cases such as in RTC-only mode, we are able to skip reading eeprom
+ * and wasting i2c based initialization time by using predefined flags for
+ * detecting what platform we are booting on. For those platforms, provide
+ * a handy function to pre-program information.
+ *
+ * NOTE: many eeprom information such as serial number, mac address etc is not
+ * available.
+ *
+ * Return: 0 if all went fine, else return error.
+ */
+int ti_i2c_eeprom_am_set(const char *name, const char *rev);
+
#endif /* __BOARD_DETECT_H */