I would need to look at that code more, but what is typically done is the boundary registers are programmed so that the ram "size" is 0x4000000 and all the commands for setup are sent to the ram. Once all the ram init is done, then the actual row boundaries are set.
We do it this way because it saves a lot of computation that is not really needed.
ron