mksunxiboot: Fix loading of files with a size which is not a multiple of 4

We should not be aligning the amount of bytes which we try to read from the
disk, this leads to trying to read more bytes then there are which fails.

file_size is already aligned to BLOCK_SIZE before being stored in
img.header.length, so there is no need for load_size at all.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
mvtwsi: Fix clock programming

The TWSI_FREQUENCY macro was wrong in 2 ways:
1) It was casting the result of the calculations to an u8, while i2c clk
rates are often >= 100Khz which won't fit in a u8, drop the cast.
2) It had an extra factor of 2 in the divider which neither the datasheet nor
the Linux driver have.

The comment for the default value was wrongly saying that m lives in
bits 4-7, while in reality it is in bits 3-6, as can be seen from the correct
shift by 3 used in i2c_init().

While at it remove the unused twsi_actual_speed variable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
mvtwsi: Remove unnecessary twsi_baud_rate and twsi_slave_address globals

These are used only once, so their is no need to have them global.

This also stops mvtwsi from using any bss vars making it easier to use
before dram init (to talk to the pmic to set the dram voltage).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Use existing mvtwsi code for i2c master

Sunxi uses the same i2c controller, so re-use the existing code instead of
having our own duplicate code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>