I previously wrote one person on this subject (this), but the processor was different - but a positive result is the same.
To be honest, I'm happy to dig into yours source code, but do not have time.
I will upload the major/base changes that I made for the AP96 platform.
Based on the changes(changes between the original and RAM mod Uboot) and this sources, I hope you understand the issue.
In patch or sources:
Where all "SKIP_LOWLEVEL_INIT" = U-boot RAM mod
Where CFG_PLL_OFFSET, CFG_PLL_MAGIC = responsible for the variable of CPU frequency.
I'm sorry for my terrible English.
OK, I understand what you want to get but I'm afraid that option "SKIP_LOWLEVEL_INIT" isn't exist in U-Boot 1.1.4 (which is used by TP-Link) for AR7240... so it needs to be added. Maybe I will try.
I don't think (but maybe I'm wrong!) also that setting new frequency for PLL and dividers for CPU/DDR/AHB on AR9331 is so simple like in the code you pointed to (just writing prepared register value into PLL setting register):
It needs to be tested because Assembler section for PLL initialization in original sources is bigger and contains more PLL and dividers registers operations.
For now I'm thinking about new command in U-Boot console for PLL clock and CPU/DDR/AHB dividers manipulation, just for testing if we can change these values simply by changing proper registers, without reset the CPU and changing also other registers.
Exactly how I write the bootloader to an 8MB Flash chip (SST25VF064, 8 pin SOIC version) using Flashrom and a Bus Pirate? (As in what settings to get the bootloader to the correct part of Flash.) I'm upgrading a TL-WR702N (already did the RAM) and I already took out the old Flash chip and read it out to a file. Besides the bootloader itself, what else do I need to copy over so it can boot?
All you need to do is just erase whole chip (fill it with 0xFF) and put my U-Boot image at offset 0x0 (beginning of the FLASH). The ART image you can upload later in web panel. You need also to copy 64 KiB (from offset 0x10000) data from your original flash - this block contains MAC address and model number. Please, refer to the following flash layout:
But, for now in my U-Boot modification you FLASH won't be recognized properly and you won't be able to upload ART image! I will add it in next couple of days. Please, provide me full chip mark.