Browse Source

Merge branch 'master' of git://git.denx.de/u-boot-fdt

Tom Rini 9 years ago
parent
commit
996ec1dcc5
5 changed files with 26 additions and 17 deletions
  1. 4 0
      arch/arm/dts/exynos4210-trats.dts
  2. 4 6
      arch/arm/mach-exynos/clock.c
  3. 11 7
      drivers/gpio/s5p_gpio.c
  4. 3 1
      dts/Kconfig
  5. 4 3
      lib/fdtdec.c

+ 4 - 0
arch/arm/dts/exynos4210-trats.dts

@@ -117,4 +117,8 @@
 	sdhci@12540000 {
 	sdhci@12540000 {
 		status = "disabled";
 		status = "disabled";
 	};
 	};
+
+	dwmmc@12550000 {
+		status = "disabled";
+	};
 };
 };

+ 4 - 6
arch/arm/mach-exynos/clock.c

@@ -1661,6 +1661,9 @@ unsigned long get_mmc_clk(int dev_index)
 {
 {
 	enum periph_id id;
 	enum periph_id id;
 
 
+	if (cpu_is_exynos4())
+		return exynos4_get_mmc_clk(dev_index);
+
 	switch (dev_index) {
 	switch (dev_index) {
 	case 0:
 	case 0:
 		id = PERIPH_ID_SDMMC0;
 		id = PERIPH_ID_SDMMC0;
@@ -1679,12 +1682,7 @@ unsigned long get_mmc_clk(int dev_index)
 		return -1;
 		return -1;
 	}
 	}
 
 
-	if (cpu_is_exynos5())
-		return clock_get_periph_rate(id);
-	else if (cpu_is_exynos4())
-		return exynos4_get_mmc_clk(dev_index);
-
-	return 0;
+	return clock_get_periph_rate(id);
 }
 }
 
 
 void set_mmc_clk(int dev_index, unsigned int div)
 void set_mmc_clk(int dev_index, unsigned int div)

+ 11 - 7
drivers/gpio/s5p_gpio.c

@@ -341,18 +341,22 @@ static int gpio_exynos_bind(struct udevice *parent)
 		plat = calloc(1, sizeof(*plat));
 		plat = calloc(1, sizeof(*plat));
 		if (!plat)
 		if (!plat)
 			return -ENOMEM;
 			return -ENOMEM;
-		reg = fdtdec_get_addr(blob, node, "reg");
-		if (reg != FDT_ADDR_T_NONE)
-			bank = (struct s5p_gpio_bank *)((ulong)base + reg);
-		plat->bank = bank;
-		plat->bank_name = fdt_get_name(blob, node, NULL);
-		debug("dev at %p: %s\n", bank, plat->bank_name);
 
 
+		plat->bank_name = fdt_get_name(blob, node, NULL);
 		ret = device_bind(parent, parent->driver,
 		ret = device_bind(parent, parent->driver,
-					plat->bank_name, plat, -1, &dev);
+				  plat->bank_name, plat, -1, &dev);
 		if (ret)
 		if (ret)
 			return ret;
 			return ret;
+
 		dev->of_offset = node;
 		dev->of_offset = node;
+
+		reg = dev_get_addr(dev);
+		if (reg != FDT_ADDR_T_NONE)
+			bank = (struct s5p_gpio_bank *)((ulong)base + reg);
+
+		plat->bank = bank;
+
+		debug("dev at %p: %s\n", bank, plat->bank_name);
 	}
 	}
 
 
 	return 0;
 	return 0;

+ 3 - 1
dts/Kconfig

@@ -37,7 +37,9 @@ config OF_EMBED
 	bool "Embedded DTB for DT control"
 	bool "Embedded DTB for DT control"
 	help
 	help
 	  If this option is enabled, the device tree will be picked up and
 	  If this option is enabled, the device tree will be picked up and
-	  built into the U-Boot image.
+	  built into the U-Boot image. This is suitable for local debugging
+	  and development only and is not recommended for production devices.
+	  Boards in the mainline U-Boot tree should not use it.
 
 
 config OF_HOSTFILE
 config OF_HOSTFILE
 	bool "Host filed DTB for DT control"
 	bool "Host filed DTB for DT control"

+ 4 - 3
lib/fdtdec.c

@@ -149,7 +149,7 @@ fdt_addr_t fdtdec_get_addr_size_auto_parent(const void *blob, int parent,
 	}
 	}
 
 
 	ns = fdt_size_cells(blob, parent);
 	ns = fdt_size_cells(blob, parent);
-	if (ns < 1) {
+	if (ns < 0) {
 		debug("(bad #size-cells)\n");
 		debug("(bad #size-cells)\n");
 		return FDT_ADDR_T_NONE;
 		return FDT_ADDR_T_NONE;
 	}
 	}
@@ -180,10 +180,11 @@ fdt_addr_t fdtdec_get_addr_size_auto_noparent(const void *blob, int node,
 fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
 fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
 		const char *prop_name, fdt_size_t *sizep)
 		const char *prop_name, fdt_size_t *sizep)
 {
 {
+	int ns = sizep ? (sizeof(fdt_size_t) / sizeof(fdt32_t)) : 0;
+
 	return fdtdec_get_addr_size_fixed(blob, node, prop_name, 0,
 	return fdtdec_get_addr_size_fixed(blob, node, prop_name, 0,
 					  sizeof(fdt_addr_t) / sizeof(fdt32_t),
 					  sizeof(fdt_addr_t) / sizeof(fdt32_t),
-					  sizeof(fdt_size_t) / sizeof(fdt32_t),
-					  sizep);
+					  ns, sizep);
 }
 }
 
 
 fdt_addr_t fdtdec_get_addr(const void *blob, int node,
 fdt_addr_t fdtdec_get_addr(const void *blob, int node,