![]() |
|
|||||||
| Samples Use this forum for questions or comments regarding specific sample source code files in the Linux SDK. |
![]() |
|
|
Thread Tools | Display Modes |
|
#11
|
|||
|
|||
|
Quote:
--Mike |
|
#12
|
|||
|
|||
|
Yes.
It is linux-2.6.x/arch/m68knommu/platform/520x/cpconfig-xport_pro.h |
|
#13
|
|||
|
|||
|
hello,
i'm using SDK 2.0.0.0, XPort Pro. My configuration is: KConfig->Processor type and features->[*] CP driver support ->Lantronix CP Man->[*] GPIO cpm.conf has been adjusted to Xport Pro: CP1-CP3 my cpconfig-xport_pro.h: =========================================== static struct cp_board_config xport_pro_cp_map[] = { [0] = { #ifdef CONFIG_LTRX_CPM_MANUALY_CP1_DEVICE .func = (CPM_FUNC_SER_HWFLOW_OUT | PLATFORM_UART0), .initval = 0, .assertlow = CPM_ASSERT_DEFAULT, #else .func = CPM_FUNC_GEN_OUTPUT, .initval = 0, .assertlow = CPM_ASSERT_HIGH, #endif }, [1] = { #ifdef CONFIG_LTRX_CPM_MANUALY_CP2_DEVICE .func = CPM_FUNC_GEN_INPUT, .initval = 0, .assertlow = CPM_ASSERT_HIGH, #else .func = CPM_FUNC_GEN_OUTPUT, .initval = 0, .assertlow = CPM_ASSERT_HIGH, #endif }, [2] = { #ifdef CONFIG_LTRX_CPM_MANUALY_CP3_DEVICE .func = (CPM_FUNC_SER_HWFLOW_IN | PLATFORM_UART0), .initval = 0, .assertlow = CPM_ASSERT_DEFAULT, #else .func = CPM_FUNC_GEN_OUTPUT, .initval = 0, .assertlow = CPM_ASSERT_HIGH, #endif }, }; SAMPLE-APP 'LED' console-output with 'DEBUG': =================================== cp_config_data_output(1,0) ... 0 cp_config_data_output(2,0) ... 0 cp_config_data_output(3,0) ... 0 ... cp_config_data_output(1,1) ... 0 cp_config_data_output(2,1) ... 0 cp_config_data_output(3,0) ... 0 ... SAMPLE-APP 'CPM' console output ========================= / # cpm -s -d -n 1 -v 1 cp_number=1 cp_value=1 flag=0x202 cp_config_init() ... 3 (0x7,4) cp_config_validate(1) ... 0 cp_config_type_set(1,1) ... 0 cp_config_invert_set(1,0) ... 0 cp_config_state_set(1,1) ... 0 cp_config_validate(2) ... 0 cp_config_type_set(2,1) ... 0 cp_config_invert_set(2,0) ... 0 cp_config_state_set(2,1) ... 0 cp_config_validate(3) ... 0 cp_config_type_set(3,1) ... 0 cp_config_invert_set(3,0) ... 0 cp_config_state_set(3,1) ... 0 cp_group_create(LED) ... 0 cp_group_type_set(LED,1) ... 0 cp_config_validate(1) ... 0 cp_group_add(LED,0,1) ... 0 cp_config_validate(2) ... 0 cp_group_add(LED,1,2) ... 0 cp_config_validate(3) ... 0 cp_group_add(LED,2,3) ... 0 cp_config_type_set(1,1) ... 0 cp_config_state_set(1,1) ... 0 cp_config_type_set(2,1) ... 0 cp_config_state_set(2,1) ... 0 cp_config_type_set(3,1) ... 0 cp_config_state_set(3,1) ... 0 cp_group_state_set(LED,1) ... 0 cp_config_data_output(1,1) ... 0 * CP configuration status * CP# Type State Invert Value ---- -------- -------- -------- ----- cp_config_read(1,0x4067be74) ... 0 cp_config_data_input(1,0) ... 0 <= why not '(1,1)' CP1 Output Enabled Disabled 0 cp_config_read(2,0x4067be74) ... 0 cp_config_data_input(2,0) ... 0 CP2 Output Enabled Disabled 0 cp_config_read(3,0x4067be74) ... 0 cp_config_data_input(3,0) ... 0 CP3 Output Enabled Disabled 0 cp_config_read(4,0x4067be74) ... -1 * CP group status * cp_group_read_by_index(0,0x4067be0a) ... 0 cp_config_level_input(1,0) ... 0 cp_config_level_input(2,0) ... 0 cp_config_level_input(3,0) ... 0 cp_group_level_input(LED,0) ... 0 cp_config_data_input(1,0) ... 0 cp_config_data_input(2,0) ... 0 cp_config_data_input(3,0) ... 0 cp_group_data_input(LED,0) ... 0 cp_config_read(1,0x4067bddc) ... 0 cp_config_read(2,0x4067bddc) ... 0 cp_config_read(3,0x4067bddc) ... 0 Name : LED Type : Output State : Enabled Value : 0 (0x00000000) Logic : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx Level : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx--- Binary : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx000 CP# : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx321 cp_group_read_by_index(1,0x4067be0a) ... -1 and with '/ # cpm -s -d -n 2 -v 1' ============================== ... CP# Type State Invert Value ---- -------- -------- -------- ----- cp_config_read(1,0x4067be74) ... 0 cp_config_data_input(1,0) ... 0 CP1 Output Enabled Disabled 0 cp_config_read(2,0x4067be74) ... 0 cp_config_data_input(2,1) ... 0 <= seems to work CP2 Output Enabled Disabled 1 cp_config_read(3,0x4067be74) ... 0 cp_config_data_input(3,0) ... 0 CP3 Output Enabled Disabled 0 cp_config_read(4,0x4067be74) ... -1 => the same output for CP3 like CP1; Any help, why I'm not able to configure CP1/CP3, but CP2 does work correctly? Best regards votug |
|
#14
|
|||
|
|||
|
Hello,
CP1/CP3 were set to the signal for serial. Please try the following modification. linux/linux-2.6.x/drivers/serial/mcf_cpm.c line 118 - if ((mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) || - (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_UNUSED)) { + if (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) { Best regards |
|
#15
|
|||
|
|||
|
many thanks for your help, it works fine!
greetings |
|
#16
|
|||
|
|||
|
I got it working on SDK 2.0.0.0 beta following votug and applying tfujii's modifications. I'm quite impressed now.
|
|
#17
|
|||
|
|||
|
tfujii's comment worked for me as well on the V2.0 Beta SDK.
THANKS!!! |
|
#18
|
|||
|
|||
|
to Tfujii:
my <sdk>/linux/linux-2.6.x/drivers/serial/mcf_cpm.c at line 118 Code:
/* if ((mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) ||
(mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_UNUSED)) {*/
if (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) {
unsigned short par;
copy images to /tftpboot/ Code:
dnfl linux.bin dn rootfs.img fl w 0x00400000 0x4001FF80 0x400000 gfl Code:
config cp1 {
type output
state enable
invert disable
}
group LED {
type output
state enable
bit0 cp1
}
Code:
# cpm -N LED -V 1 Warning CP1 is invalid Warning CP1 is invalid Thanks for your help. |
|
#19
|
|||
|
|||
|
Hello meloun,
Please confirm CP manager setup of kernel configuration. Code:
Linux Kernel Configuration
Processor type and features --->
Lantronix CP Manager (General Purpose I/O)
Then, please change value into 'General Purpose I/O' and retry it. Regards, |
|
#20
|
|||
|
|||
|
that's it!! thanks!
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|