As far as I know the first stage bootloader tries to load bootcode.bin from SD card. How does it find it on SD card? Should it be placed in particular sectors or can initial bootloader work with partitions and look for it as a file?
I haven't read any documentation about this, but applying a little deduction:
Should it be placed in particular sectors
This is obviously not the case, since all you need to do is create a (v)fat32 first partition and place the file in there.
Which implies the answer is exactly that: the hardware bootloader can read a partition table and fat32 format and looks for a first partition with a file called
bootcode.bin. After that, as far as I'm aware, anything can happen depending on what that binary does.
Note the card is always MBR formatted, and I am certain the hardware bootloader reads this (it's the first 512 byte block on the device) to find the first partition, which in standard images tends to have a 4 MB offset, but I am pretty sure I have used a smaller value and so this is not necessary (i.e., it reads the partition table to find the first partition, and does not assume it has a specific offset).