Lines Matching refs:sata
33 static inline int write_env(struct blk_desc *sata, unsigned long size, in write_env() argument
38 blk_start = ALIGN(offset, sata->blksz) / sata->blksz; in write_env()
39 blk_cnt = ALIGN(size, sata->blksz) / sata->blksz; in write_env()
41 n = blk_dwrite(sata, blk_start, blk_cnt, buffer); in write_env()
49 struct blk_desc *sata = NULL; in env_sata_save() local
57 sata = sata_get_dev(env_sata); in env_sata_save()
58 if (sata == NULL) { in env_sata_save()
69 if (write_env(sata, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, (u_char *)env_new)) { in env_sata_save()
79 static inline int read_env(struct blk_desc *sata, unsigned long size, in read_env() argument
84 blk_start = ALIGN(offset, sata->blksz) / sata->blksz; in read_env()
85 blk_cnt = ALIGN(size, sata->blksz) / sata->blksz; in read_env()
87 n = blk_dread(sata, blk_start, blk_cnt, buffer); in read_env()
95 struct blk_desc *sata = NULL; in env_sata_load() local
103 sata = sata_get_dev(env_sata); in env_sata_load()
104 if (sata == NULL) { in env_sata_load()
109 if (read_env(sata, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, buf)) { in env_sata_load()
117 U_BOOT_ENV_LOCATION(sata) = {