mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
mgsuvd: fix coding style
Signed-off-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
5f4c3137f4
commit
cac9cf7875
2 changed files with 33 additions and 44 deletions
|
@ -20,11 +20,6 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
* MA 02111-1307 USA
|
* MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <mpc8xx.h>
|
#include <mpc8xx.h>
|
||||||
|
|
||||||
|
@ -157,80 +152,76 @@ int hush_init_var (void)
|
||||||
/*
|
/*
|
||||||
* update "memory" property in the blob
|
* update "memory" property in the blob
|
||||||
*/
|
*/
|
||||||
void ft_blob_update(void *blob, bd_t *bd)
|
void ft_blob_update (void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
int ret, nodeoffset = 0;
|
int ret, nodeoffset = 0;
|
||||||
ulong brg_data[1] = {0};
|
ulong brg_data[1] = {0};
|
||||||
ulong memory_data[2] = {0};
|
ulong memory_data[2] = {0};
|
||||||
ulong flash_data[4] = {0};
|
ulong flash_data[4] = {0};
|
||||||
|
|
||||||
memory_data[0] = cpu_to_be32(bd->bi_memstart);
|
memory_data[0] = cpu_to_be32 (bd->bi_memstart);
|
||||||
memory_data[1] = cpu_to_be32(bd->bi_memsize);
|
memory_data[1] = cpu_to_be32 (bd->bi_memsize);
|
||||||
|
|
||||||
nodeoffset = fdt_path_offset (blob, "/memory");
|
nodeoffset = fdt_path_offset (blob, "/memory");
|
||||||
if (nodeoffset >= 0) {
|
if (nodeoffset >= 0) {
|
||||||
ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
|
ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
|
||||||
sizeof(memory_data));
|
sizeof (memory_data));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
printf("ft_blob_update(): cannot set /memory/reg "
|
printf("ft_blob_update(): cannot set /memory/reg "
|
||||||
"property err:%s\n", fdt_strerror(ret));
|
"property err:%s\n", fdt_strerror (ret));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* memory node is required in dts */
|
/* memory node is required in dts */
|
||||||
printf("ft_blob_update(): cannot find /memory node "
|
printf("ft_blob_update(): cannot find /memory node "
|
||||||
"err:%s\n", fdt_strerror(nodeoffset));
|
"err:%s\n", fdt_strerror (nodeoffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
flash_data[2] = cpu_to_be32(bd->bi_flashstart);
|
flash_data[2] = cpu_to_be32 (bd->bi_flashstart);
|
||||||
flash_data[3] = cpu_to_be32(bd->bi_flashsize);
|
flash_data[3] = cpu_to_be32 (bd->bi_flashsize);
|
||||||
nodeoffset = fdt_path_offset (blob, "/localbus");
|
nodeoffset = fdt_path_offset (blob, "/localbus");
|
||||||
if (nodeoffset >= 0) {
|
if (nodeoffset >= 0) {
|
||||||
ret = fdt_setprop(blob, nodeoffset, "ranges", flash_data,
|
ret = fdt_setprop (blob, nodeoffset, "ranges", flash_data,
|
||||||
sizeof(flash_data));
|
sizeof (flash_data));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
printf("ft_blob_update(): cannot set /localbus/ranges "
|
printf("ft_blob_update(): cannot set /localbus/ranges "
|
||||||
"property err:%s\n", fdt_strerror(ret));
|
"property err:%s\n", fdt_strerror (ret));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* memory node is required in dts */
|
/* memory node is required in dts */
|
||||||
printf("ft_blob_update(): cannot find /localbus node "
|
printf("ft_blob_update(): cannot find /localbus node "
|
||||||
"err:%s\n", fdt_strerror(nodeoffset));
|
"err:%s\n", fdt_strerror (nodeoffset));
|
||||||
}
|
}
|
||||||
/* BRG */
|
/* BRG */
|
||||||
brg_data[0] = cpu_to_be32(bd->bi_busfreq);
|
brg_data[0] = cpu_to_be32 (bd->bi_busfreq);
|
||||||
nodeoffset = fdt_path_offset (blob, "/soc/cpm");
|
nodeoffset = fdt_path_offset (blob, "/soc/cpm");
|
||||||
if (nodeoffset >= 0) {
|
if (nodeoffset >= 0) {
|
||||||
ret = fdt_setprop(blob, nodeoffset, "brg-frequency", brg_data,
|
ret = fdt_setprop (blob, nodeoffset, "brg-frequency", brg_data,
|
||||||
sizeof(brg_data));
|
sizeof (brg_data));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
printf("ft_blob_update(): cannot set /soc/cpm/brg-frequency "
|
printf("ft_blob_update(): cannot set /soc/cpm/brg-frequency "
|
||||||
"property err:%s\n", fdt_strerror(ret));
|
"property err:%s\n", fdt_strerror(ret));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* memory node is required in dts */
|
/* memory node is required in dts */
|
||||||
printf("ft_blob_update(): cannot find /soc/cpm node "
|
printf("ft_blob_update(): cannot find /soc/cpm node "
|
||||||
"err:%s\n", fdt_strerror(nodeoffset));
|
"err:%s\n", fdt_strerror (nodeoffset));
|
||||||
}
|
}
|
||||||
/* MAC Adresse */
|
/* MAC Adresse */
|
||||||
nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
|
nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
|
||||||
if (nodeoffset >= 0) {
|
if (nodeoffset >= 0) {
|
||||||
ret = fdt_setprop(blob, nodeoffset, "mac-address", bd->bi_enetaddr,
|
ret = fdt_setprop (blob, nodeoffset, "mac-address", bd->bi_enetaddr,
|
||||||
sizeof(uchar) * 6);
|
sizeof (uchar) * 6);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
printf("ft_blob_update(): cannot set /soc/cpm/scc/mac-address "
|
printf("ft_blob_update(): cannot set /soc/cpm/scc/mac-address "
|
||||||
"property err:%s\n", fdt_strerror(ret));
|
"property err:%s\n", fdt_strerror (ret));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* memory node is required in dts */
|
/* memory node is required in dts */
|
||||||
printf("ft_blob_update(): cannot find /soc/cpm/ethernet node "
|
printf("ft_blob_update(): cannot find /soc/cpm/ethernet node "
|
||||||
"err:%s\n", fdt_strerror(nodeoffset));
|
"err:%s\n", fdt_strerror (nodeoffset));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ft_board_setup(void *blob, bd_t *bd)
|
void ft_board_setup(void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
ft_cpu_setup( blob, bd);
|
ft_cpu_setup (blob, bd);
|
||||||
ft_blob_update(blob, bd);
|
ft_blob_update (blob, bd);
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
|
#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
|
||||||
|
|
||||||
|
|
|
@ -359,18 +359,16 @@
|
||||||
#define I2C_READ i2c_soft_read_pin ()
|
#define I2C_READ i2c_soft_read_pin ()
|
||||||
#define I2C_SDA(bit) if(bit) { \
|
#define I2C_SDA(bit) if(bit) { \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) &= ~SDA_CONF; \
|
*(unsigned short *)(I2C_BASE_DIR) &= ~SDA_CONF; \
|
||||||
} \
|
} else { \
|
||||||
else { \
|
|
||||||
*(unsigned char *)(I2C_BASE_PORT) &= ~SDA_BIT; \
|
*(unsigned char *)(I2C_BASE_PORT) &= ~SDA_BIT; \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) |= SDA_CONF; \
|
*(unsigned short *)(I2C_BASE_DIR) |= SDA_CONF; \
|
||||||
}
|
}
|
||||||
#define I2C_SCL(bit) if(bit) { \
|
#define I2C_SCL(bit) if(bit) { \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) &= ~SCL_CONF; \
|
*(unsigned short *)(I2C_BASE_DIR) &= ~SCL_CONF; \
|
||||||
} \
|
} else { \
|
||||||
else { \
|
|
||||||
*(unsigned char *)(I2C_BASE_PORT) &= ~SCL_BIT; \
|
*(unsigned char *)(I2C_BASE_PORT) &= ~SCL_BIT; \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) |= SCL_CONF; \
|
*(unsigned short *)(I2C_BASE_DIR) |= SCL_CONF; \
|
||||||
}
|
}
|
||||||
#define I2C_DELAY udelay(50) /* 1/4 I2C clock duration */
|
#define I2C_DELAY udelay(50) /* 1/4 I2C clock duration */
|
||||||
|
|
||||||
#define CONFIG_I2C_MULTI_BUS 1
|
#define CONFIG_I2C_MULTI_BUS 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue