[U-Boot] oddity(?) in selection of FCC Ethernet index in 2014 version of u-boot
Robert P. J. Day
rpjday at crashcourse.ca
Sat Feb 13 12:04:36 CET 2016
at the moment, i'm trying to get a minimal u-boot running on an
MPC8280-based
target board (please, no jokes), and for the sake of expediency, i
just used git
to check out a version of u-boot just before it removed the definition
of a target
board (MPC8260ads) that seems moderately close to what i'm after. so i checked
out git commit 373a9788f05dfab47e01badc046459dead163104, which is dated May of
2014 to see what I could do with that, and I found the following oddity(?).
I actually selected the (8280-based) PQ2FADS board:
$ make PQ2FADS_config
and started tweaking until i got to configuring Ethernet support on FCC. the
board definition file MPC8260ADS.h contains the following snippet for
selecting
Ethernet on FCC:
#ifdef CONFIG_ETHER_ON_FCC
#define CONFIG_ETHER_INDEX 2 /* which SCC/FCC channel for
ethernet */
#if CONFIG_ETHER_INDEX == 1
# define CONFIG_SYS_PHY_ADDR 0
# define CONFIG_SYS_CMXFCR_VALUE1 (CMXFCR_RF1CS_CLK11 |
CMXFCR_TF1CS_CLK10)
# define CONFIG_SYS_CMXFCR_MASK1 (CMXFCR_FC1 | CMXFCR_RF1CS_MSK
| CMXFCR_TF1CS_MSK)
#elif CONFIG_ETHER_INDEX == 2
#if CONFIG_ADSTYPE == CONFIG_SYS_8272ADS /* RxCLK is CLK15,
TxCLK is CLK16 */
# define CONFIG_SYS_PHY_ADDR 3
# define CONFIG_SYS_CMXFCR_VALUE2 (CMXFCR_RF2CS_CLK15 |
CMXFCR_TF2CS_CLK16)
#else /* RxCLK is CLK13, TxCLK is CLK14 */
# define CONFIG_SYS_PHY_ADDR 0
# define CONFIG_SYS_CMXFCR_VALUE2 (CMXFCR_RF2CS_CLK13 |
CMXFCR_TF2CS_CLK14)
#endif /* CONFIG_ADSTYPE == CONFIG_SYS_8272ADS */
# define CONFIG_SYS_CMXFCR_MASK2 (CMXFCR_FC2 | CMXFCR_RF2CS_MSK
| CMXFCR_TF2CS_MSK)
#endif /* CONFIG_ETHER_INDEX */
fair enough ... the above clearly implies that Ethernet on FCC will be
defined by the values of the two variables:
CONFIG_ETHER_ON_FCC
CONFIG_ETHER_INDEX
but here's the puzzler -- this appears to be implemented by the source file
arch/powerpc/cpu/mpc8260/ether_fcc.c (it is in fact compiled), but that file
contains the snippet:
#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET)
static struct ether_fcc_info_s
{
int ether_index;
int proff_enet;
ulong cpm_cr_enet_sblock;
ulong cpm_cr_enet_page;
ulong cmxfcr_mask;
ulong cmxfcr_value;
}
ether_fcc_info[] =
{
#ifdef CONFIG_ETHER_ON_FCC1
{
0,
PROFF_FCC1,
CPM_CR_FCC1_SBLOCK,
CPM_CR_FCC1_PAGE,
CONFIG_SYS_CMXFCR_MASK1,
CONFIG_SYS_CMXFCR_VALUE1
},
#endif
#ifdef CONFIG_ETHER_ON_FCC2
... snip ...
note that the board header file sets CONFIG_ETHER_INDEX to identify the
channel, but that source file checks the variables CONFIG_ETHER_ON_FCC1,
CONFIG_ETHER_ON_FCC2 and so on, which are not set in the board definition
file.
i took a look and, back then, some boards defined CONFIG_ETHER_ON_FCCn,
while others set CONFIG_ETHER_INDEX. it seems that doing it that second way
could not possibly have worked. i'm just writing this off to bit-rot in that
nobody really looked at those old boards for a long time. but am i right in
concluding that using CONFIG_ETHER_INDEX to select the FCC channel could not
possibly have worked? or am i missing something?
rday
p.s. to be more precise about the target board, a group of us are porting
linux to the Mitel 3300 AX Controller. so if you've been down that or a
similar road, i'd love to hear from you.
More information about the U-Boot
mailing list