Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot-2015.04
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
u-boot-2015.04
Commits
fa722ea7
Commit
fa722ea7
authored
14 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of /home/wd/git/u-boot/custodians
parents
812083d3
b9d77535
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch/powerpc/cpu/mpc5xxx/i2c.c
+43
-0
43 additions, 0 deletions
arch/powerpc/cpu/mpc5xxx/i2c.c
post/drivers/i2c.c
+2
-1
2 additions, 1 deletion
post/drivers/i2c.c
with
45 additions
and
1 deletion
arch/powerpc/cpu/mpc5xxx/i2c.c
+
43
−
0
View file @
fa722ea7
...
@@ -30,6 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
...
@@ -30,6 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
#include
<mpc5xxx.h>
#include
<mpc5xxx.h>
#include
<i2c.h>
#include
<i2c.h>
#if !defined(CONFIG_I2C_MULTI_BUS)
#if (CONFIG_SYS_I2C_MODULE == 2)
#if (CONFIG_SYS_I2C_MODULE == 2)
#define I2C_BASE MPC5XXX_I2C2
#define I2C_BASE MPC5XXX_I2C2
#elif (CONFIG_SYS_I2C_MODULE == 1)
#elif (CONFIG_SYS_I2C_MODULE == 1)
...
@@ -37,6 +38,19 @@ DECLARE_GLOBAL_DATA_PTR;
...
@@ -37,6 +38,19 @@ DECLARE_GLOBAL_DATA_PTR;
#else
#else
#error CONFIG_SYS_I2C_MODULE is not properly configured
#error CONFIG_SYS_I2C_MODULE is not properly configured
#endif
#endif
#else
static
unsigned
int
i2c_bus_num
__attribute__
((
section
(
".data"
)))
=
CONFIG_SYS_SPD_BUS_NUM
;
static
unsigned
int
i2c_bus_speed
[
2
]
=
{
CONFIG_SYS_I2C_SPEED
,
CONFIG_SYS_I2C_SPEED
};
static
const
unsigned
long
i2c_dev
[
2
]
=
{
MPC5XXX_I2C1
,
MPC5XXX_I2C2
,
};
#define I2C_BASE ((struct mpc5xxx_i2c *)i2c_dev[i2c_bus_num])
#endif
#define I2C_TIMEOUT 6667
#define I2C_TIMEOUT 6667
#define I2C_RETRIES 3
#define I2C_RETRIES 3
...
@@ -439,4 +453,33 @@ Done:
...
@@ -439,4 +453,33 @@ Done:
return
ret
;
return
ret
;
}
}
#if defined(CONFIG_I2C_MULTI_BUS)
int
i2c_set_bus_num
(
unsigned
int
bus
)
{
if
(
bus
>
1
)
return
-
1
;
i2c_bus_num
=
bus
;
i2c_init
(
i2c_bus_speed
[
bus
],
CONFIG_SYS_I2C_SLAVE
);
return
0
;
}
int
i2c_set_bus_speed
(
unsigned
int
speed
)
{
i2c_init
(
speed
,
CONFIG_SYS_I2C_SLAVE
);
return
0
;
}
unsigned
int
i2c_get_bus_num
(
void
)
{
return
i2c_bus_num
;
}
unsigned
int
i2c_get_bus_speed
(
void
)
{
return
i2c_bus_speed
[
i2c_bus_num
];
}
#endif
#endif
/* CONFIG_HARD_I2C */
#endif
/* CONFIG_HARD_I2C */
This diff is collapsed.
Click to expand it.
post/drivers/i2c.c
+
2
−
1
View file @
fa722ea7
...
@@ -63,11 +63,12 @@ int i2c_post_test (int flags)
...
@@ -63,11 +63,12 @@ int i2c_post_test (int flags)
unsigned
int
i
;
unsigned
int
i
;
#ifndef CONFIG_SYS_POST_I2C_ADDRS
#ifndef CONFIG_SYS_POST_I2C_ADDRS
/* Start at address 1, address 0 is the general call address */
/* Start at address 1, address 0 is the general call address */
for
(
i
=
1
;
i
<
128
;
i
++
)
for
(
i
=
1
;
i
<
128
;
i
++
)
{
if
(
i2c_ignore_device
(
i
))
if
(
i2c_ignore_device
(
i
))
continue
;
continue
;
if
(
i2c_probe
(
i
)
==
0
)
if
(
i2c_probe
(
i
)
==
0
)
return
0
;
return
0
;
}
/* No devices found */
/* No devices found */
return
-
1
;
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment