mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-06 15:01:35 +00:00
To test drivers, we need a way to fake I2C periphrals. With this CL, a fake peripheral can be done by declaring its own I2C read/write functions. The fake I2C peripherals may return EC_ERROR_INVAL to indicate it's not responding. The emulator I2C read/write call scans through all registered I2C peripherals and uses the first response. BUG=chrome-os-partner:19235 TEST=Pass sbs_charging test with the next CL. BRANCH=None Change-Id: I9380dc40e147781b42e09eb6979c864bbd9f2ac4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169511 Reviewed-by: Randall Spangler <rspangler@chromium.org>
109 lines
2.5 KiB
Plaintext
109 lines
2.5 KiB
Plaintext
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
SECTIONS {
|
|
.rodata.ec_sections : {
|
|
/* Symbols defined here are declared in link_defs.h */
|
|
__irqprio = .;
|
|
*(.rodata.irqprio)
|
|
__irqprio_end = .;
|
|
|
|
. = ALIGN(8);
|
|
__cmds = .;
|
|
*(SORT(.rodata.cmds*))
|
|
__cmds_end = .;
|
|
|
|
. = ALIGN(8);
|
|
__hcmds = .;
|
|
*(.rodata.hcmds)
|
|
__hcmds_end = .;
|
|
|
|
. = ALIGN(8);
|
|
__hooks_init = .;
|
|
*(.rodata.HOOK_INIT)
|
|
__hooks_init_end = .;
|
|
|
|
__hooks_pre_freq_change = .;
|
|
*(.rodata.HOOK_PRE_FREQ_CHANGE)
|
|
__hooks_pre_freq_change_end = .;
|
|
|
|
__hooks_freq_change = .;
|
|
*(.rodata.HOOK_FREQ_CHANGE)
|
|
__hooks_freq_change_end = .;
|
|
|
|
__hooks_sysjump = .;
|
|
*(.rodata.HOOK_SYSJUMP)
|
|
__hooks_sysjump_end = .;
|
|
|
|
__hooks_chipset_pre_init = .;
|
|
*(.rodata.HOOK_CHIPSET_PRE_INIT)
|
|
__hooks_chipset_pre_init_end = .;
|
|
|
|
__hooks_chipset_startup = .;
|
|
*(.rodata.HOOK_CHIPSET_STARTUP)
|
|
__hooks_chipset_startup_end = .;
|
|
|
|
__hooks_chipset_resume = .;
|
|
*(.rodata.HOOK_CHIPSET_RESUME)
|
|
__hooks_chipset_resume_end = .;
|
|
|
|
__hooks_chipset_suspend = .;
|
|
*(.rodata.HOOK_CHIPSET_SUSPEND)
|
|
__hooks_chipset_suspend_end = .;
|
|
|
|
__hooks_chipset_shutdown = .;
|
|
*(.rodata.HOOK_CHIPSET_SHUTDOWN)
|
|
__hooks_chipset_shutdown_end = .;
|
|
|
|
__hooks_ac_change = .;
|
|
*(.rodata.HOOK_AC_CHANGE)
|
|
__hooks_ac_change_end = .;
|
|
|
|
__hooks_lid_change = .;
|
|
*(.rodata.HOOK_LID_CHANGE)
|
|
__hooks_lid_change_end = .;
|
|
|
|
__hooks_pwrbtn_change = .;
|
|
*(.rodata.HOOK_POWER_BUTTON_CHANGE)
|
|
__hooks_pwrbtn_change_end = .;
|
|
|
|
__hooks_charge_state_change = .;
|
|
*(.rodata.HOOK_CHARGE_STATE_CHANGE)
|
|
__hooks_charge_state_change_end = .;
|
|
|
|
__hooks_tick = .;
|
|
*(.rodata.HOOK_TICK)
|
|
__hooks_tick_end = .;
|
|
|
|
__hooks_second = .;
|
|
*(.rodata.HOOK_SECOND)
|
|
__hooks_second_end = .;
|
|
|
|
__deferred_funcs = .;
|
|
*(.rodata.deferred)
|
|
__deferred_funcs_end = .;
|
|
|
|
__test_i2c_read8 = .;
|
|
*(.rodata.test_i2c.read8)
|
|
__test_i2c_read8_end = .;
|
|
|
|
__test_i2c_write8 = .;
|
|
*(.rodata.test_i2c.write8)
|
|
__test_i2c_write8_end = .;
|
|
|
|
__test_i2c_read16 = .;
|
|
*(.rodata.test_i2c.read16)
|
|
__test_i2c_read16_end = .;
|
|
|
|
__test_i2c_write16 = .;
|
|
*(.rodata.test_i2c.write16)
|
|
__test_i2c_write16_end = .;
|
|
|
|
__test_i2c_read_string = .;
|
|
*(.rodata.test_i2c.read_string)
|
|
__test_i2c_read_string_end = .;
|
|
}
|
|
}
|
|
INSERT BEFORE .rodata;
|