[beagleboard] Question about: xloader code, relocation section

Nope, re-read the comments in the source. :wink:

  cmp r0, r1 /* no need to relocate if XIP */
  beq stack_setup /* skip txt cpy if XIP(SRAM, SDRAM) */

Regards,

Ok, maybe it is clear to you. From the comments I see what this code is trying to do: If the code is in flash, then need to relocate to RAM, if the code is in RAM or SDRAM then it can be XIP and no need to copy, since we cannot XIP from memory card or NAND (which I don’t have anyway)…Yes, YEs, I get that. But the question is: how can the code already be in RAM or SDRAM if after reset it is put there by the x-loader in the first place: wouldn’t it have to be copied every time???

Thanks.

Ok, maybe it is clear to you. From the comments I see what this code is trying to do: If the code is in flash, then need to relocate to RAM, if the code is in RAM or SDRAM then
it can be XIP and no need to copy, since we cannot XIP from memory card or NAND (which I don't have anyway)...Yes, YEs, I get that. But the question is: how can the code already
be in RAM or SDRAM if after reset it is put there by the x-loader in the first place: wouldn't it have to be copied /every time/???

Depends on your hardware. The same code can work on a variety of boards,
some of which might have NOR FLASH which can XIP, etc. Quite often, and
this is such a case, code is written for the general case, not a specific
board/implementation.

Gary, I see your point now, especially as it relates to NOR flash which is XIP.

Thanks for your rational explanation.

I’m curious if you know of any implementation that puts code in RAM/ SDRAM without the X-LOADER setting up first??..or is it just a theoretical scenario.

Thanks