Minimal requirements – Comtrol eCos User Manual
Page 327

Chapter 11. Porting Guide
substantially different. Please try to adhere to the following as much is possible without causing yourself too much
grief integrating with a HAL which does not follow this layout.
Minimal requirements
These are the changes you must make before you attempt to build RedBoot. You are advised to read all the sources
though.
1. Copy an existing platform HAL from the same or another architecture. Rename the files as necessary to follow
the standard: CDL and MLT related files should contain the
2. Adjust CDL options. Primarily option naming, real-time clock/counter, and CYGHWR_MEMORY_LAYOUT
variables, but also other options may need editing. Look through the architecture/variant CDL files to see if
there are any requirements/features which where not used on the platform you copied. If so, add appropriate
ones. See
the Section called HAL Platform CDL
for more details.
3. Add the necessary packages and target descriptions to the top-level
ecos.db
file. See
. Initially, the target entry should only contain the HAL packages. Other hardware support packages
will be added later.
4. Adjust the MLT files in
include/pkgconf
to match the memory layout on the platform. For initial testing
it should be enough to just hand edit .h and .ldi files, but eventually you should generate all files using the
memory layout editor in the configuration tool. See
the Section called Platform Memory Layout
for more
details.
5. Edit the
misc/redboot_
<
STARTUP
>
.ecm
for the startup type you have chosen to begin with. Rename
any platform specific options and remove any that do not apply. In the
cdl_configuration
section, com-
ment out any extra packages that are added, particularly packages such as
CYGPKG_IO_FLASH
and
CYG-
PKG_IO_ETH_DRIVERS
. These are not needed for initial porting and will be added back later.
6. If the default IO macros are not correct, override them in plf_io.h. This may be necessary if the platform uses
a different endianness from the default for the CPU.
7. Leave out/comment out code that enables caches and/or MMU if possible. Execution speed will not be a
concern until the port is feature complete.
8. Implement a simple serial driver (polled mode only). Make sure the initialization function properly hooks the
procedures up in the virtual vector IO channel tables. RedBoot will call the serial driver via these tables.
By copying an existing platform HAL most of this code will be already done, and will only need the platform
specific hardware access code to be written.
9. Adjust/implement necessary platform initialization. This can be found in
platform.inc
and
platform.S
files (ARM:
hal_platform_setup.h
and
<
platform
>
_misc.c
, PowerPC:
<
platform
>
.S
). This step
can be postponed if you are doing a RAM startup RedBoot first and the existing ROM monitor handles board
initialization.
10. Define
HAL_STUB_PLATFORM_RESET
(optionally empty) and
HAL_STUB_PLATFORM_RESET_ENTRY
so that
RedBoot can reset-on-detach - this is very handy, often removing the need for physically resetting the board
between downloads.
You should now be able to build RedBoot. For ROM startup:
% ecosconfig new
<
target_name
>
redboot
223