common: env: support sata device
PATCH v3 1/1 common: env: support sata device
Introduce env support for sata device.
1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
2. If want to enable this feature, define CONFIG_ENV_IS_IN_SATA, and define CONFIG_SYS_SATA_ENV_DEV or implement your own sata_get_ev_dev.
---
V3:
Discard the ENV_IS_EMBEDDED test which was missed to removed in V2.
V2:
Add error msg when ENV REDUND, since not supported now. Discard ent_ptr
Use blk_dread/blk_dwrite
cmd/nvedit.c | 3 +- common/Makefile | 1 + common/env_sata.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 common/env_sata.c
cmd/nvedit.c +2 -1
@@ -49,12 +49,13 @@ DECLARE_GLOBAL_DATA_PTR; !defined (CONFIG_ENV_IS_IN_NAND ) && \ !defined (CONFIG_ENV_IS_IN_NVRAM ) && \ !defined (CONFIG_ENV_IS_IN_ONENAND ) && \ + !defined (CONFIG_ENV_IS_IN_SATA ) && \ !defined (CONFIG_ENV_IS_IN_SPI_FLASH ) && \ !defined (CONFIG_ENV_IS_IN_REMOTE ) && \ !defined (CONFIG_ENV_IS_IN_UBI ) && \ !defined(CONFIG_ENV_IS_NOWHERE)# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\ -SPI_FLASH|NVRAM|MMC|FAT|EXT4|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE +SATA|SPI_FLASH|NVRAM|MMC|FAT|EXT4|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE#endif /*
common/Makefile +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_ENV_IS_IN_EXT4) += env_ext4.o obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o obj-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o +obj-$(CONFIG_ENV_IS_IN_SATA) += env_sata.o obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o obj-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o obj-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
common/env_sata.c new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
2.6.2
PATCH v3 1/1 common: env: support sata device
Quoted 5 lines · Peng Fan
Introduce env support for sata device.
1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
2. If want to enable this feature, defineCONFIG_ENV_IS_IN_SATA, and defineCONFIG_SYS_SATA_ENV_DEVor implement your ownsata_get_ev_dev.
Quoted 9 lines
Signed-off-by Peng Fan <[email protected]>Cc Simon Glass <[email protected]>Cc Joe Hershberger <[email protected]>Cc Bin Meng <[email protected]>Cc Stefan Roese <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stuart Longland <[email protected]>Cc Maxime Ripard <[email protected]>Cc Tom Rini <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160408/efe4d2a7/attachment.sig>
PATCH v3 1/1 common: env: support sata device
Quoted 17 lines · Tom Rini
Quoted 5 lines · Peng Fan
Introduce env support for sata device.
1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
2. If want to enable this feature, defineCONFIG_ENV_IS_IN_SATA, and defineCONFIG_SYS_SATA_ENV_DEVor implement your ownsata_get_ev_dev.Quoted 9 lines
Signed-off-by Peng Fan <[email protected]>Cc Simon Glass <[email protected]>Cc Joe Hershberger <[email protected]>Cc Bin Meng <[email protected]>Cc Stefan Roese <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stuart Longland <[email protected]>Cc Maxime Ripard <[email protected]>Cc Tom Rini <[email protected]>
Quoted 4 lines
Reviewed-by Tom Rini <[email protected]>--
Tom
Ugh, we really should move this to linker lists or driver model. Do we really want to make that conversion even harder by adding one more option?
Regards,
Simon
PATCH v3 1/1 common: env: support sata device
Quoted 18 lines · Simon Glass
Quoted 17 lines · Tom Rini
Quoted 14 lines · Peng Fan
Introduce env support for sata device.
1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
2. If want to enable this feature, defineCONFIG_ENV_IS_IN_SATA, and defineCONFIG_SYS_SATA_ENV_DEVor implement your ownsata_get_ev_dev.Signed-off-by Peng Fan <[email protected]>Cc Simon Glass <[email protected]>Cc Joe Hershberger <[email protected]>Cc Bin Meng <[email protected]>Cc Stefan Roese <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stuart Longland <[email protected]>Cc Maxime Ripard <[email protected]>Cc Tom Rini <[email protected]>
Quoted 8 lines
Quoted 4 lines
Reviewed-by Tom Rini <[email protected]>--
TomUgh, we really should move this to linker lists or driver model. Do we really want to make that conversion even harder by adding one more option?
linker lists for env? But I'd put Kconfig'ing env at the top of my wish list for env changes before DM. This should be an easy conversion too :)
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160411/db3a6d5e/attachment.sig>
PATCH v3 1/1 common: env: support sata device
In reply to Peng FanQuoted 5 lines · Peng Fan
Introduce env support for sata device.
1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
2. If want to enable this feature, defineCONFIG_ENV_IS_IN_SATA, and defineCONFIG_SYS_SATA_ENV_DEVor implement your ownsata_get_ev_dev.
Quoted 10 lines
Signed-off-by Peng Fan <[email protected]>Cc Simon Glass <[email protected]>Cc Joe Hershberger <[email protected]>Cc Bin Meng <[email protected]>Cc Stefan Roese <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stuart Longland <[email protected]>Cc Maxime Ripard <[email protected]>Cc Tom Rini <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160421/8f00ebc9/attachment.sig>