1 From 60e8a35f0efa5a7e5d797a3f239971c84061ef11 Mon Sep 17 00:00:00 2001
2 From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 Date: Tue, 6 Nov 2012 21:39:47 +0100
4 Subject: sf: handle CONFIG_MANUAL_RELOC
6 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
8 --- a/drivers/mtd/spi/spi_flash.c
9 +++ b/drivers/mtd/spi/spi_flash.c
10 @@ -293,7 +293,7 @@ int spi_flash_cmd_write_status(struct sp
12 #define IDCODE_CONT_LEN 0
13 #define IDCODE_PART_LEN 5
14 -static const struct {
18 struct spi_flash *(*probe) (struct spi_slave *spi, u8 *idcode);
19 @@ -335,6 +335,10 @@ static const struct {
21 #define IDCODE_LEN (IDCODE_CONT_LEN + IDCODE_PART_LEN)
23 +#ifdef CONFIG_NEEDS_MANUAL_RELOC
24 +DECLARE_GLOBAL_DATA_PTR;
27 struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
28 unsigned int max_hz, unsigned int spi_mode)
30 @@ -342,6 +346,16 @@ struct spi_flash *spi_flash_probe(unsign
31 struct spi_flash *flash = NULL;
33 u8 idcode[IDCODE_LEN], *idp;
34 +#ifdef CONFIG_NEEDS_MANUAL_RELOC
35 + static int relocated;
38 + for (i = 0; i < ARRAY_SIZE(flashes); i++)
39 + flashes[i].probe += gd->reloc_off;
45 spi = spi_setup_slave(bus, cs, max_hz, spi_mode);