[U-Boot] [PATCH] net: convert altera_tse to driver model and phylib

Marek Vasut marex at denx.de
Thu Oct 22 03:53:53 CEST 2015


On Wednesday, October 21, 2015 at 03:09:27 PM, Thomas Chou wrote:
> Hi Marek,

Hi!

> On 10/19/2015 08:31 PM, Marek Vasut wrote:
> >> +	/* decode regs, assume address-cells and size-cells are both one */
> >> +	list = fdt_getprop(blob, node, "reg-names", &len);
> >> +	if (!list)
> >> +		return -ENOENT;
> >> +	end = list + len;
> >> +	cell = fdt_getprop(blob, node, "reg", &len);
> >> +	if (!cell)
> >> +		return -ENOENT;
> >> +	idx = 0;
> >> +	while (list < end) {
> >> +		addr = fdt_translate_address((void *)blob,
> >> +					     node, cell + idx);
> >> +		size = fdt_addr_to_cpu(cell[idx + 1]);
> >> +		base = ioremap(addr, size);
> >> +		len = strlen(list);
> >> +		if (strcmp(list, "control_port") == 0)
> >> +			priv->mac_dev = base;
> > 
> > fdtdec_get_addr() won't do here?
> 
> There are multiple "reg" tuples, and need to match "reg-names". That's
> beyond fdtdec_get_addr().
> 
> 	tse_mac: ethernet at 0x4000 {
> 		compatible = "altr,tse-1.0";
> 		reg = <0x00004000 0x00000400>,
> 			<0x00004400 0x00000040>,
> 			<0x00004800 0x00000040>,
> 			<0x00002000 0x00002000>;
> 		reg-names = "control_port", "rx_csr", "tx_csr", "s1";
> 
> Thanks a lot for your reviews.

Gotcha, thanks!

Best regards,
Marek Vasut


More information about the U-Boot mailing list