[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Undocumented feature in uClinux MLD/TCL



Hi folks,

There is an undocumented feature in the uClinux MLD/TCL, that is useful
when using cores like the OPB_EMC as a generic memory mapped interface
to some off-chip device, like a USB transeiver, ethernet MAC/PHY, and so
on.  Details below.  I hope to release some reasonable doco on the
uClinux BSP shortly - the following is snipped from an early draft.

Hope it's useful,

John


There are some instances where the user requires more control over the
BSP automated naming scheme.  A common example is when using the
External Memory Controller (EMC) core as a generic memory mapped
interface to an off-chip device such as a USB controller, or external
Ethernet MAC/PHY device.  Another example is defining a GPIO for some
specific purpose or role, such as controlling LEDs or monitoring switches.

Using the EMC as an example, under the automated naming scheme the core
parameters (mostly BASEADDR and HIGHADDR) will be named

CONFIG_XILINX_EMC_n_BASEADDR
CONFIG_XILINX_EMC_n_HIGHADDR

where "n" is dependent upon the relative ordering of the EMC interface
core with respect to other EMC cores in the system MHS file.  This
raises two issues.

* Firstly, these parameters do not really represent an external memory -
they are just an interface to some other kind of device

* Secondly, and perhaps more importantly, it is impossible to write a
generic device driver for the particular off-chip device, because the
numbering scheme ("n" above) is entirely dependent on other components
of the system.  Even if 'n' could be fixed, the parameter names do not
represent the underlying truth of the system.

To work around these issues, it is possible to override the peripheral
type generated by the BSP tools, on an instance by instance basis.  In
the example above it allows the user to alias the EMC peripheral to
something more meaningful and expressive.

This is achieved by the PERIPH_TYPE_OVERRIDES uClinux BSP parameter.
Its usage is best explained by example.  Consider the situation of using
the OPB_EMC core as an interface to an off-chip USB host controller,
using the following MHS file fragment:

BEGIN opb_emc
…
   PARAMETER HW_INSTANCE=usb_interface0
   PARAMETER C_BASEADDR=0x10000000
   PARAMETER C_HIGHADDR=0x10000FFF
  …
END

By default, the uClinux BSP tools would generate kernel configuration
parameters such as

CONFIG_XILINX_EMC_n_BASEADDR = 0x10000000
CONFIG_XILINX_EMC_n_HIGHADDR = 0x10000FFF

Placing the following parameter declaration in the OS section of the MSS
file

PARAMETER PERIPH_TYPE_OVERRIDES = "{usb_interface0 my_usb}"

will result in the BSP parameters:

CONFIG_XILINX_MY_USB_0_BASEADDR = 0x10000000
CONFIG_XILINX_MY_USB_0_HIGHADDR = 0x10000000
CONFIG_XILINX_MY_USB_0_.... = ....
...

Multiple overrides are specified in a consistent manner.  For example,
two EMC controllers interfacing to two off-chip USB controllers might be
described as follows (all on one line in the MSS file):

PARAMETER PERIPH_TYPE_OVERRIDES = "{usb_interface0 my_usb}
	{usb_interface1 my_usb}"

This example demonstrates a subtle point.  The syntax of the peripheral
override parameter is

{instance_name periph_type} {instance_name periph_type} …

It is telling the BSP generation tools to override the peripheral type,
for a particular instance.


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/